Fix gh permissions to publish gh-pages #101
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: Publish website | |
on: | |
# branches pushed by collaborators | |
push: | |
branches: | |
- docs | |
jobs: | |
build: | |
name: Build & Deploy | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
steps: | |
# checkout code | |
- uses: actions/checkout@v2 | |
# install node | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
# Render typedoc | |
- run: npm install && npx typedoc | |
# Render docusaurus and deploy website | |
- run: | | |
set -euo pipefail | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
cd website | |
yarn | |
yarn deploy | |
env: | |
GIT_USER: ${{ github.actor }} | |
GIT_PASS: ${{ secrets.GITHUB_TOKEN }} |