-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#385] Refine GitHub Actions workflow for optimized Docker image hand…
…ling Optimized the build-and-deploy GitHub Actions workflow to streamline the deployment process. Removed redundant `make docker-login` and `make build-[backend|frontend]` steps, focusing directly on pushing the pre-built Docker images with `make push-backend` and `make push-frontend`. Added a crucial verification step to ensure the deployment environment is properly defined, enhancing the reliability of the deployment pipeline. This update ensures a more efficient and error-resilient deployment process by minimizing unnecessary steps and reinforcing environmental checks.
- Loading branch information
Showing
1 changed file
with
6 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ jobs: | |
- name: Check environment exists | ||
run: | | ||
make check-env-defined | ||
build_backend: | ||
name: Build and push backend Docker image | ||
if: ${{ ! inputs.skip_build }} | ||
|
@@ -69,9 +70,8 @@ jobs: | |
aws-region: eu-west-1 | ||
- name: Build and push images | ||
run: | | ||
make docker-login | ||
make build-backend | ||
make push-backend | ||
build_frontend: | ||
name: Build and push frontend Docker image | ||
if: ${{ ! inputs.skip_build }} | ||
|
@@ -99,11 +99,10 @@ jobs: | |
GTM_ID: ${{ secrets.GTM_ID }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} | ||
run: | | ||
make docker-login | ||
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi; | ||
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi; | ||
make build-frontend | ||
make push-frontend | ||
deploy: | ||
name: Deploy app | ||
needs: | ||
|
@@ -143,24 +142,11 @@ jobs: | |
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} | ||
- name: Prepare and upload app config | ||
run: | | ||
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi; | ||
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi; | ||
export DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network} | ||
make prepare-config | ||
make upload-config | ||
- name: Destroy Cardano Node, DB sync and Postgres if required | ||
if: ${{ inputs.resync_cardano_node_and_db }} | ||
run: | | ||
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi; | ||
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi; | ||
make destroy-cardano-node-and-dbsync; | ||
- name: Deploy app | ||
run: | | ||
make docker-login | ||
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi; | ||
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi; | ||
export DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network} | ||
make deploy-stack | ||
- name: Reprovision Grafana | ||
run: | | ||
|
@@ -178,7 +164,9 @@ jobs: | |
run: | | ||
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi; | ||
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi; | ||
export DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network} | ||
make notify | ||
deploy_without_build: | ||
name: Deploy app without building | ||
if: ${{ inputs.skip_build }} | ||
|