summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevhen Bondarenko <evgeniy.bondarenko@sentrium.io>2024-11-05 12:13:20 +0100
committerGitHub <noreply@github.com>2024-11-05 12:13:20 +0100
commita96debdfd68aeb20ef18dc1052941e1615aa6eb2 (patch)
tree1eb3a1d24f68256ef3b3672b6549b88b1d235bd6
parent77b238ebb839bc9c42caf86d0e231a3da915cdca (diff)
downloadcommunity.vyos.net-a96debdfd68aeb20ef18dc1052941e1615aa6eb2.tar.gz
community.vyos.net-a96debdfd68aeb20ef18dc1052941e1615aa6eb2.zip
test05
-rw-r--r--.github/workflows/main.yml22
1 files changed, 18 insertions, 4 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index eb1c929..00c9057 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -18,6 +18,12 @@ on:
branch:
required: true
type: string
+ aws_amplify_region:
+ required: true
+ type: string
+ aws_amplify_app_id:
+ required: true
+ type: string
secrets:
AWS_AMPLIFY_ACCESS_KEY_ID:
required: true
@@ -36,13 +42,21 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
+ - name: Set env variables if they were NOT specified as inputs
+ if: ${{ inputs.aws_amplify_region == '' || inputs.aws_amplify_app_id == '' }}
+ run: |
+ echo "AWS_AMPLIFY_REGION=${{ vars.AWS_AMPLIFY_REGION }}" >> $GITHUB_ENV
+ echo "AWS_AMPLIFY_APP_ID=${{ vars.AWS_AMPLIFY_APP_ID }}" >> $GITHUB_ENV
+
+ - name: Set env variables if they were specified as inputs
+ if: ${{ inputs.aws_amplify_region != '' && inputs.aws_amplify_app_id != '' }}
+ run: |
+ echo "AWS_AMPLIFY_REGION=${{ inputs.aws_amplify_region }}" >> $GITHUB_ENV
+ echo "AWS_AMPLIFY_APP_ID=${{ inputs.aws_amplify_app_id }}" >> $GITHUB_ENV
- 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 \
+ --url https://amplify.${{ env.AWS_AMPLIFY_REGION }}.amazonaws.com/apps/${{ env.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 }}" \