From bce45f1efa20db5a41137d0e12e28f064991eb80 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 7 Aug 2022 21:33:59 -0500 Subject: [PATCH] chore: set up ci and deploy workflows --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ .github/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..65f7f36 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: + - '**' + # - '!main' + +jobs: + test_and_build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.1 + - uses: actions/setup-node@v1 + with: + node-version: 'lts/*' + - run: npm ci --no-optional + - run: npm test + + - name: 'Build web app artifacts' + run: npm run build + + - uses: actions/upload-artifact@v3 + with: + name: build-output + path: build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f291d16 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy to Github Pages + +on: + push: + branches: + - main + + workflow_dispatch: + +jobs: + deployment: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + cache: 'npm' + + - name: Build + run: | + npm i + npm run build + + # https://github.com/marketplace/actions/deploy-to-github-pages + - name: Deploy + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.DEPLOY_KEY }} + BRANCH: gh-pages + FOLDER: build + CLEAN: true + SINGLE_COMMIT: true