From a1954b44cc25ead719c5978ebe30cdfced706e62 Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Mon, 2 Dec 2024 17:04:36 +0800 Subject: [PATCH] feat: updat testnet auto deployment --- .github/workflows/testnet_deploy.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testnet_deploy.yml b/.github/workflows/testnet_deploy.yml index 263b993d..6cf8d12c 100644 --- a/.github/workflows/testnet_deploy.yml +++ b/.github/workflows/testnet_deploy.yml @@ -11,11 +11,11 @@ jobs: env: SSH_HOST: sepolia.api.starknet.quest SSH_USER: ubuntu - REPO_PATH: '~/api.starknet.quest' - AWS_PATH: 'lfg-labs/api.starknet.quest/sepolia' + REPO_PATH: "~/api.starknet.quest" + AWS_PATH: "lfg-labs/api.starknet.quest/sepolia" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: 'eu-west-3' + AWS_DEFAULT_REGION: "eu-west-3" steps: - name: Setting up SSH key uses: webfactory/ssh-agent@v0.5.3 @@ -33,10 +33,13 @@ jobs: aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY aws configure set default.region $AWS_DEFAULT_REGION + cd api.starknet.id/ + sudo docker compose down quest_server + cd ../ + if [ -d "\$REPO_PATH/.git" ]; then echo "Repository exists, pulling changes..." cd \$REPO_PATH - sudo docker-compose down git reset --hard HEAD git pull else @@ -51,5 +54,7 @@ jobs: sudo chmod -R 755 \$REPO_PATH aws s3 cp s3://$AWS_PATH/ \$REPO_PATH --recursive - sudo docker-compose up --build -d + cd ../api.starknet.id/ + sudo docker-compose up --build -d quest_server + EOF