Skip to content

Deploy amplify

Deploy amplify #138

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
- master-arbitrum
paths:
- 'amplify/**'
concurrency:
group: ${{ github.ref }}-cdapp-amplify
cancel-in-progress: true
# Set global env variables
env:
AWS_REGION: ${{ vars.AWS_REGION }}
jobs:
# Deploy cdapp amplify to QA environment
deployQA:
runs-on: ubuntu-latest
env:
AWS_AMPLIFY_WEBHOOK: ${{ github.ref == 'refs/heads/master' && vars.AWS_AMPLIFY_WEBHOOK_QA || github.ref == 'refs/heads/master-arbitrum' && vars.AWS_AMPLIFY_WEBHOOK_QA_ARBITRUM_SEPOLIA }}
AWS_AMPLIFY_APP_ID_QA: ${{ vars.AWS_AMPLIFY_APP_ID_QA }}
steps:
- name: Trigger Amplify AWS Pipeline
run: |
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK}&operation=startbuild" -H "Content-Type:application/json"
- name: Post AWS Amplify console link in GH summary
run: |
echo "### AWS Amplify pipeline" >> $GITHUB_STEP_SUMMARY
echo "Amplify build triggered, progress can be tracked in the [AWS Console](https://${AWS_REGION}.console.aws.amazon.com/amplify/home?region=${AWS_REGION}#/${AWS_AMPLIFY_APP_ID_QA})." >> $GITHUB_STEP_SUMMARY
- 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
env:
AWS_AMPLIFY_WEBHOOK: ${{ github.ref == 'refs/heads/master' && vars.AWS_AMPLIFY_WEBHOOK_PROD || github.ref == 'refs/heads/master-arbitrum' && vars.AWS_AMPLIFY_WEBHOOK_PROD_ARBITRUM }}
AWS_AMPLIFY_APP_ID_PROD: ${{ vars.AWS_AMPLIFY_APP_ID_PROD }}
steps:
- name: Trigger Amplify AWS Pipeline
run: |
curl -X POST -d {} "${AWS_AMPLIFY_WEBHOOK}&operation=startbuild" -H "Content-Type:application/json"
- name: Post AWS Amplify console link in GH summary
run: |
echo "### AWS Amplify pipeline" >> $GITHUB_STEP_SUMMARY
echo "Amplify build triggered, progress can be tracked in the [AWS Console](https://${AWS_REGION}.console.aws.amazon.com/amplify/home?region=${AWS_REGION}#/${AWS_AMPLIFY_APP_ID_PROD})." >> $GITHUB_STEP_SUMMARY
- uses: sarisia/actions-status-discord@c193626e5ce172002b8161e116aa897de7ab5383
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: 'Deploy cdapp amplify to prod'