From 21c3e449f27bc988ff4b3e45b44ef654a5bce229 Mon Sep 17 00:00:00 2001 From: Nicola Zambello Date: Tue, 14 Dec 2021 10:53:45 +0100 Subject: [PATCH] ci: deploy to gh pages --- .github/workflows/main.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9a1525..bf1476f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Test and deploy on: push: @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: ubuntu-latest strategy: matrix: @@ -26,5 +26,16 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install dependencies run: yarn - - name: Run compiler - run: yarn tsc + - name: Run tests + run: yarn test + - name: Run build + if: success() + run: yarn build + - name: Deploy to GitHub Pages + if: success() + uses: crazy-max/ghaction-github-pages@v2.5.0 + with: + target_branch: gh-pages + build_dir: dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}