From d5f2f5d2f1626d68f7dbf96c45a7a7da24b096a0 Mon Sep 17 00:00:00 2001 From: Ash Martian Date: Fri, 24 Nov 2023 11:33:15 -0800 Subject: [PATCH] Github Action --- .github/workflows/push.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..af74c7f --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,28 @@ +## Github Action: A simple `npm run build` command will build the app and sync it to an S3 bucket with aws cli. + +name: Push +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 18.x + uses: actions/setup-node@v1 + with: + node-version: 18.x + - name: npm install, build, and test + run: | + npm install + npm run build + - name: Deploy to S3 + run: | + aws s3 sync dist/ $AWS_BUCKET --delete + env: + AWS_BUCKET: ${{ secrets.AWS_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}