Add clarification #8
This file contains hidden or 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: Build and update documentation site | |
on: | |
push: | |
paths: | |
- 'docusaurus/**' | |
branches: | |
- main | |
jobs: | |
build-docusaurus: | |
if: "!startsWith(github.ref, 'refs/heads/update-docs-site-')" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: docusaurus | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Docusaurus | |
run: npm run build | |
- name: Remove old Docusaurus site from /docs (preserving important files) | |
run: | | |
shopt -s extglob | |
cd ../docs | |
rm -rf !(STYLE_GUIDE.md|PULL_REQUEST_TEMPLATE.md|ISSUE_TEMPLATE) | |
- name: Copy built site to docs/ | |
run: cp -r build/* ../docs/ | |
- name: Commit changes to a new branch | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
BRANCH_NAME="update-docs-site-$(date +%s)" | |
git checkout -b $BRANCH_NAME | |
git add ../docs | |
git commit -m "Update Docusaurus site [skip ci]" || echo "No changes to commit" | |
git push origin $BRANCH_NAME | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update Docusaurus site [skip ci] | |
branch: ${{ github.ref_name }} | |
title: 'Update Docusaurus site' | |
body: 'This PR updates the static documentation site.' | |
base: main | |