From 494bd6370ba7e9029f801a75847b555b028225c5 Mon Sep 17 00:00:00 2001 From: Jake Boone Date: Thu, 4 Nov 2021 08:15:03 -0700 Subject: [PATCH] GitHub Actions to deploy on push or merge to main --- .github/workflows/gh-pages.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000000..1ffe6fde13 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,41 @@ +name: publish + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + checks: + if: github.event_name != 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '14.x' + - name: Test Build + run: | + yarn install --frozen-lockfile + npm run build + gh-release: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '14.x' + - uses: webfactory/ssh-agent@v0.5.0 + with: + ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} + - name: Release to GitHub Pages + env: + USE_SSH: true + GIT_USER: git + run: | + git config --global user.email "jakeboone02@gmail.com" + git config --global user.name "Jake Boone" + yarn install --frozen-lockfile + npm run deploy