Skip to content

Commit

Permalink
Update aws-amplify.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Sep 13, 2024
1 parent 1a5d3c4 commit fc28a67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/aws-amplify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
AWS_REGION: ${{ vars.AWS_REGION }}
NEXT_PUBLIC_API_DOMAIN: ${{ vars.NEXT_PUBLIC_API_DOMAIN }}
AMPLIFY_APP_ID: ${{ vars.AMPLIFY_APP_ID }}
S3_BUCKET: ${{ vars.S3_BUCKET }}

permissions:
id-token: write
Expand Down Expand Up @@ -63,6 +64,10 @@ jobs:
run: zip -r build.zip ./.next
working-directory: ./client

- name: Upload Build to S3
run: |
aws s3 cp ./client/build.zip s3://${{ env.S3_BUCKET }}/builds/${{ github.sha }}.zip
- name: Check if branch exists in Amplify
id: check_branch
run: |
Expand All @@ -82,8 +87,9 @@ jobs:
run: |
branch_name="${{ github.head_ref }}"
app_id="${{ vars.AMPLIFY_APP_ID }}"
source_url="s3://${{ env.S3_BUCKET }}/builds/${{ github.sha }}.zip"
aws amplify start-deployment --app-id $app_id --branch-name $branch_name --file ./client/build.zip --output json > deployment.json
aws amplify start-deployment --app-id $app_id --branch-name $branch_name --source-url $source_url --output json > deployment.json
- name: Output deployment details
run: |
Expand Down

0 comments on commit fc28a67

Please sign in to comment.