Skip to content

Commit

Permalink
[#484] Restrict manual deployment to the dev server only
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
placek committed Mar 18, 2024
1 parent 3a8c191 commit 43b24a7
Showing 1 changed file with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 43b24a7

Please sign in to comment.