test04 #2393
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. | |
# We run this workflow on pushes and also every night to pick up fresh nightly builds | |
on: | |
push: | |
branches: | |
- main | |
- production | |
- amplify | |
schedule: | |
- cron: "0 3 * * *" | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
branch: | |
required: true | |
type: string | |
secrets: | |
AWS_AMPLIFY_ACCESS_KEY_ID: | |
required: true | |
AWS_AMPLIFY_SECRET_ACCESS_KEY: | |
required: true | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
deploy: | |
environment: | |
name: ${{ github.ref_name }} | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Deploy to Amplify | |
env: | |
AWS_AMPLIFY_REGION: ${{ vars.AWS_AMPLIFY_REGION }} | |
AWS_AMPLIFY_APP_ID: ${{ vars.AWS_AMPLIFY_APP_ID }} | |
run: | | |
curl --request POST \ | |
--url https://amplify.$AWS_AMPLIFY_REGION.amazonaws.com/apps/$AWS_AMPLIFY_APP_ID/branches/${{ github.ref_name }}/jobs \ | |
--header 'Content-Type: application/json' \ | |
--data '{"jobType": "RELEASE"}' \ | |
--user "${{ secrets.AWS_AMPLIFY_ACCESS_KEY_ID }}:${{ secrets.AWS_AMPLIFY_SECRET_ACCESS_KEY }}" \ | |
--aws-sigv4 "aws:amz:${{ env.AWS_AMPLIFY_REGION }}:amplify" | |
- name: Check Amplify build status | |
uses: vyos/[email protected] | |
with: | |
app-id: ${{ env.AWS_AMPLIFY_APP_ID }} | |
branch-name: ${{ github.ref_name }} | |
commit-id: HEAD | |
wait: true | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AMPLIFY_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AMPLIFY_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ env.AWS_AMPLIFY_REGION }} |