From 43b24a7f7bb578d59cdee9a904164dfe57e9e1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Fri, 15 Mar 2024 06:58:01 +0100 Subject: [PATCH] [#484] Restrict manual deployment to the dev server only Modified the existing GitHub Action workflow file, renaming it from "build-and-deploy.yml" to "build-and-deploy-dev.yml," to limit manual deployment functionality specifically to the dev server. This adjustment ensures that the manual deploy option is available exclusively for the dev environment, enhancing control over deployment procedures for specific servers. Changes: - Renamed the workflow file from "build-and-deploy.yml" to "build-and-deploy-dev.yml" to designate manual deployment for the dev server solely. - Updated the workflow configuration to set the deployment environment to "dev" by default, restricting manual deployment to this environment. - Removed conditional logic related to setting the domain based on different environments to streamline the deployment process for the dev server. - Eliminated the step for destroying Cardano Node, DB sync, and Postgres instances as it was not necessary for manual deployments to the dev server. --- ...nd-deploy.yml => build-and-deploy-dev.yml} | 44 +++---------------- 1 file changed, 5 insertions(+), 39 deletions(-) rename .github/workflows/{build-and-deploy.yml => build-and-deploy-dev.yml} (57%) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy-dev.yml similarity index 57% rename from .github/workflows/build-and-deploy.yml rename to .github/workflows/build-and-deploy-dev.yml index a7b892b9b..63cb63cf6 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy-dev.yml @@ -1,32 +1,13 @@ -name: Build and deploy app -run-name: Deploy to ${{ inputs.environment }}/${{ inputs.cardano_network }} by @${{ github.actor }} +name: Build and deploy GovTool to DEV server +run-name: Deploy by @${{ github.actor }} on: workflow_dispatch: - inputs: - cardano_network: - required: true - type: choice - default: "sanchonet" - options: - - "sanchonet" - environment: - required: true - type: choice - default: "dev" - options: - - "dev" - - "test" - - "staging" - - "beta" - resync_cardano_node_and_db: - required: true - type: boolean - default: false env: - ENVIRONMENT: ${{ inputs.environment || 'dev' }} - CARDANO_NETWORK: ${{ inputs.cardano_network || 'sanchonet' }} + ENVIRONMENT: "dev" + CARDANO_NETWORK: "sanchonet" + DOMAIN: "dev-sanchonet.govtool.byron.network" jobs: deploy: @@ -71,21 +52,6 @@ jobs: with: ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - name: Set domain - run: | - if [[ "${{ inputs.environment }}" == "staging" ]]; then - echo "DOMAIN=staging.govtool.byron.network" >> $GITHUB_ENV - elif [[ "${{ inputs.environment }}" == "beta" ]]; then - echo "DOMAIN=sanchogov.tools" >> $GITHUB_ENV - else - echo "DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}" >> $GITHUB_ENV - fi - - - name: Destroy Cardano Node, DB sync and Postgres if required - if: ${{ inputs.resync_cardano_node_and_db }} - run: | - make --debug=b destroy-cardano-node-and-dbsync - - name: Deploy app run: | make --debug=b all