From 952266e8243e9882373010b0eb075a3f30762a6d Mon Sep 17 00:00:00 2001 From: Kumaran Rajendhiran Date: Tue, 16 Apr 2024 13:25:08 +0530 Subject: [PATCH] Run deploy only after unit test and docker build (#23) --- .github/workflows/pipeline.yml | 2 ++ scripts/deploy_backend.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 84d33f9..224e171 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -86,6 +86,7 @@ jobs: defaults: run: shell: bash + needs: [docker_build_push] if: github.ref_name == 'main' || github.ref_name == 'dev' env: GITHUB_USERNAME: ${{ github.actor }} @@ -132,6 +133,7 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: write + needs: [docker_build_push] if: github.ref_name == 'main' || github.ref_name == 'dev' env: STAGING_BACKEND_DOMAIN: ${{ vars.STAGING_BACKEND_DOMAIN }} diff --git a/scripts/deploy_backend.sh b/scripts/deploy_backend.sh index 2d7b39c..426f845 100755 --- a/scripts/deploy_backend.sh +++ b/scripts/deploy_backend.sh @@ -17,7 +17,6 @@ check_variable "BACKEND_DOMAIN" check_variable "PORT" check_variable "DATABASE_URL" check_variable "WASP_WEB_CLIENT_URL" -check_variable "WASP_SERVER_URL" check_variable "JWT_SECRET" check_variable "STRIPE_KEY" check_variable "PRO_SUBSCRIPTION_PRICE_ID" @@ -61,7 +60,6 @@ $ssh_command "docker run --name $container_name -p $PORT:$PORT -e PORT='$PORT' \ -e DATABASE_URL='$DATABASE_URL' -e WASP_WEB_CLIENT_URL='$WASP_WEB_CLIENT_URL' \ -e JWT_SECRET='$JWT_SECRET' -e GOOGLE_CLIENT_ID='$GOOGLE_CLIENT_ID' \ -e GOOGLE_CLIENT_SECRET='$GOOGLE_CLIENT_SECRET' \ - -e WASP_SERVER_URL='$WASP_SERVER_URL' \ -e STRIPE_KEY='$STRIPE_KEY' -e PRO_SUBSCRIPTION_PRICE_ID='$PRO_SUBSCRIPTION_PRICE_ID' \ -e STRIPE_WEBHOOK_SECRET='$STRIPE_WEBHOOK_SECRET' -e ADMIN_EMAILS='$ADMIN_EMAILS' \ -d ghcr.io/$GITHUB_REPOSITORY:$TAG"