From 9df8b826f2ab4205e6a2dc88d9e031a5fbfd0351 Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Tue, 12 Nov 2024 19:34:18 -0800 Subject: [PATCH] Add frontend deployment script --- .github/workflows/deploy-frontend.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/deploy-frontend.yml diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml new file mode 100644 index 0000000..4c2a3aa --- /dev/null +++ b/.github/workflows/deploy-frontend.yml @@ -0,0 +1,37 @@ +name: Deploy Frontend + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Deploy + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read + env: + AWS_S3_ENDPOINT: ${{ secrets.AWS_S3_ENDPOINT }} + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + SOURCE_DIR: 'dist'