From 5af0033db5d319b9ce720ce10d33a62272f68e3d Mon Sep 17 00:00:00 2001 From: Noy Novera Date: Thu, 28 Nov 2024 19:01:27 +0800 Subject: [PATCH] add github actions workflow to deploy web srvc; --- .github/workflows/deploy-amplify-web-srvc.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy-amplify-web-srvc.yml diff --git a/.github/workflows/deploy-amplify-web-srvc.yml b/.github/workflows/deploy-amplify-web-srvc.yml new file mode 100644 index 0000000..7fcf1fb --- /dev/null +++ b/.github/workflows/deploy-amplify-web-srvc.yml @@ -0,0 +1,39 @@ +name: Deploy Amplify web srvc + +on: + # Runs on pushes targeting the default branch + # push: + # branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + AWS_REGION: ${{ secrets.AWS_REGION }} # set this to your preferred AWS region, e.g. us-west-1 + IAM_ROLE: ${{ secrets.IAM_ROLE }} # set this to your IAM Role + +permissions: + contents: read + id-token: write # Allow GitHub's OIDC provider to create a JSON Web Token for every run + +jobs: + deploy-amplify-web-srvc: + name: Deploy Amplify web srvc + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ env.IAM_ROLE }} + role-session-name: nynvrio-aws-github-actions-session + aws-region: ${{ env.AWS_REGION }} + + - name: Trigger application build through webhook + run: | + URL="${{ secrets.AMPLIFY_WEB_SRVC_WEBHOOK_URL }}" + curl -X POST -d {} "$URL" -H "Content-Type: application/json" \ No newline at end of file