docs: synced via GitHub Actions #7
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: Deploy project docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- src/** | |
workflow_dispatch: | |
jobs: | |
deploy-docs-to-community: | |
runs-on: ubuntu-latest | |
env: | |
NOP_SITE_REPO: nop-platform/nop-platform.gitee.io | |
steps: | |
- name: Create temp dirs | |
run: mkdir project-docs nop-site-src nop-site-dist | |
- uses: actions/checkout@v3 | |
with: | |
path: project-docs | |
- uses: actions/checkout@v3 | |
with: | |
repository: nop-platform/site | |
path: nop-site-src | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.NOP_SITE_REPO }} | |
persist-credentials: false | |
path: nop-site-dist | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 14.15.3 | |
- run: | | |
rm -rf project-docs/.knosys/sites/default/_config.yml | |
cp nop-site-src/.knosys/sites/default/_config.yml project-docs/.knosys/sites/default/_config.yml | |
cd project-docs && npm i && npm run deploy && cd .. | |
- name: Copy files | |
run: | | |
rm -rf nop-site-dist/projects/nop-entropy/docs | |
mv project-docs/.knosys/sites/default/public/projects/nop-entropy/docs nop-site-dist/projects/nop-entropy/docs | |
- name: Commit changes | |
run: | | |
cd nop-site-dist | |
git config --local user.email "nopentropy@gmail.com" | |
git config --local user.name "Nop Assistant" | |
git add . | |
git commit -m "chore: deploy docs of project Nop Entropy via GitHub Actions" | |
- uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
repository: ${{ env.NOP_SITE_REPO }} | |
directory: nop-site-dist | |
force: true |