-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.16 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Amplify Preview
on:
pull_request:
types: [labeled]
jobs:
deploy:
if: contains(github.event.label.name, 'Preview Environment')
runs-on: ubuntu-latest
continue-on-error: true
permissions:
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }}
output-credentials: true
- name: deploy PR preview
uses: CruGlobal/amplify-preview-actions@sed-replace-all
with:
branch_name: ${{ github.head_ref }}
amplify_command: deploy
env:
AWS_ACCESS_KEY_ID: ${{ steps.creds.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.creds.outputs.aws-secret-access-key }}
AmplifyAppId: ${{ secrets.AMPLIFY_APP_ID }}
AWS_REGION: 'us-east-1'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EnvironmentVariables: 'SITE_URL=https://${{ github.head_ref }}.${{ secrets.AMPLIFY_APP_ID }}.amplifyapp.com'