From 25924a3039485b27611d024f1c9ccac169f5a23a Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 16:33:35 +0200 Subject: [PATCH] PR Preview: Add Github Action --- .github/workflows/pr-preview.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pr-preview.yml diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 0000000..c126451 --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,25 @@ +name: PR-Preview + +on: + pull_request: + branches: [ main ] + +build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Yarn Install and Build + run: | + yarn install + yarn 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 \ No newline at end of file