chore: upgrade dependencies and remove mention of local testing (#10) #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests, build static files and deploy to GitHub Pages | |
on: [workflow_dispatch, push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- run: yarn install --frozen-lockfile | |
- run: yarn typecheck | |
- run: yarn prettier --check src | |
- run: yarn build | |
if: github.ref != 'refs/heads/main' | |
build: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Build static files | |
run: | | |
yarn install --frozen-lockfile | |
yarn build | |
- uses: actions/configure-pages@v3 | |
- name: Upload static files to GitHub Pages | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: "dist" | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: [test, build] | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |