Skip to content

Commit

Permalink
PR Preview: Add Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Sep 4, 2023
1 parent c59139c commit 7ae806a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr-preview.yml
@@ -0,0 +1,31 @@
name: PR-Preview

on:
pull_request:
branches: [ main ]


jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Yarn Install and Build
run: |
npm install
npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy website to pr-review
run: aws s3 sync ./build/ s3://${{ secrets.AWS_BUCKET_NAME }}/pr-${{ github.event.number }}/ --delete

0 comments on commit 7ae806a

Please sign in to comment.