Docs #1
Workflow file for this run
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: docs | |
run-name: Docs | |
on: | |
workflow_call: | |
push: | |
paths: | |
- "website/**" | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build-docs: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: yarn | |
cache-dependency-path: website/yarn.lock | |
- name: Install dependencies | |
run: | | |
cd website | |
yarn install --frozen-lockfile --non-interactive | |
- name: Do checks | |
run: | | |
cd website | |
yarn checks | |
- name: Build docs | |
run: | | |
cd website | |
yarn build | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload docs artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: website/build | |
# Deployment job only on main branch | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build-docs | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |