Docs v0.9.0 #275
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
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions | |
# Author: axmmisaka; WTFPL or BSD 3-clause | |
name: Deploy to GitHub Pages | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
# Review gh actions docs if you want to further define triggers, paths, etc | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build website | |
run: yarn build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: ./build | |
# Deployment job | |
deploy: | |
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 | |
# TODO: Deploy to some third-party place for preview? |