Skip to content

Deploy amplify

Deploy amplify #230

Workflow file for this run

name: Deploy amplify
on:
workflow_dispatch: # Allows manual workflow trigger
repository_dispatch: # Allows API workflow trigger
types: [cdapp-amplify]
# push: # Disabling auto deployment until production branch is merged
# branches:
# - master
# paths:
# - 'amplify/**'
concurrency:
group: cdapp-amplify
cancel-in-progress: true
jobs:
# Deploy cdapp amplify to QA environment
deployQA:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout repo
- name: Configure AWS credentials for Amplify
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_QA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_QA }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Amplify CLI and Run Deployment Script
run: |
curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL
export PATH="$HOME/.amplify/bin:$PATH"
amplify --version
chmod +x .github/workflows/scripts/amplify-deploy.sh
.github/workflows/scripts/amplify-deploy.sh
working-directory: ${{ github.workspace }}
env:
AMPLIFY_APP_ID: ${{ vars.AWS_AMPLIFY_APP_ID_QA }}
AMPLIFY_ENV_NAME: qa
- uses: sarisia/actions-status-discord@c193626e5ce172002b8161e116aa897de7ab5383
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: 'Deploy cdapp amplify to QA'
# Deploy cdapp amplify to prod environment
deployProd:
needs: deployQA
environment: prod
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout repo
- name: Configure AWS credentials for Amplify
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Amplify CLI and Run Deployment Script
run: |
curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL
export PATH="$HOME/.amplify/bin:$PATH"
amplify --version
chmod +x .github/workflows/scripts/amplify-deploy.sh
.github/workflows/scripts/amplify-deploy.sh
working-directory: ${{ github.workspace }}
env:
AMPLIFY_APP_ID: ${{ vars.AWS_AMPLIFY_APP_ID_PROD }}
AMPLIFY_ENV_NAME: prod
- uses: sarisia/actions-status-discord@c193626e5ce172002b8161e116aa897de7ab5383
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: 'Deploy cdapp amplify to prod'