2024/23 #65
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: Update Docs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
update-docs: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure Git | |
run: | | |
# Configure Git | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' # Update based on your project's requirements | |
- name: Build | |
run: | | |
cd docs; | |
npm install | |
cd .. | |
ls -la | |
node docs/build.js | |
- name: Checkout docs repository | |
uses: actions/checkout@v3 | |
with: | |
path: distr | |
ref: docs | |
- name: Deploy docs | |
run: | | |
rsync -av --exclude='.git/' --del build/ distr/ | |
cd distr | |
git add . | |
git commit -m "Update docs on $(date)" | |
git push --force origin docs |