Merge pull request #482 from jy95/create-pull-request/patch #679
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: Documentation | |
on: | |
push: | |
paths: | |
- '.github/workflows/documentation.yml' | |
- 'testsite/**' | |
- 'src/**' | |
repository_dispatch: | |
types: [generate-documentation] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
actions: write | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: "lts/*" | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4.1.2 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-testsite-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-testsite- | |
- name: Install lib 💻 | |
run: | | |
npm install | |
- name: Build lib 🤖 | |
run: | | |
npm run build | |
- name: Link lib 🔗 | |
run: | | |
npm link | |
- name: Install website 💻 | |
run: | | |
cd testsite | |
npm link docusaurus-json-schema-plugin --save | |
npm install --prefer-dedupe | |
npm dedupe | |
- name: Build website 🤖 | |
run: | | |
cd testsite | |
yarn build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4.0.0 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./testsite/build |