Skip to content

Commit 7ae806a

Browse files
author
Giacomo Licari
committed
PR Preview: Add Github Action
1 parent c59139c commit 7ae806a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pr-preview.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR-Preview
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
18+
- name: Yarn Install and Build
19+
run: |
20+
npm install
21+
npm run build
22+
23+
- name: Configure AWS Credentials
24+
uses: aws-actions/configure-aws-credentials@v1
25+
with:
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
aws-region: ${{ secrets.AWS_REGION }}
29+
30+
- name: Deploy website to pr-review
31+
run: aws s3 sync ./build/ s3://${{ secrets.AWS_BUCKET_NAME }}/pr-${{ github.event.number }}/ --delete

0 commit comments

Comments
 (0)