Skip to content

docs: synced via GitHub Actions #205

docs: synced via GitHub Actions

docs: synced via GitHub Actions #205

Workflow file for this run

name: Deploy project docs
on:
push:
branches:
- main
paths:
- src/**
workflow_dispatch:
jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
env:
NOP_SITE_REPO_GITHUB: nop-platform/nop-platform.github.io
steps:
- name: Create temp dirs
run: mkdir project-docs nop-site-src nop-site-github
- 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_GITHUB }}
persist-credentials: false
path: nop-site-github
- 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-github/projects/nop-entropy/docs
cp -rp project-docs/.knosys/sites/default/public/projects/nop-entropy/docs nop-site-github/projects/nop-entropy/docs
- name: Commit changes for GitHub Pages
run: |
cd nop-site-github
git config --local user.email "[email protected]"
git config --local user.name "Nop Assistant"
git add .
git commit -m "chore: deploy docs of project Nop Entropy via GitHub Actions"
cd ..
- name: Push changes for GitHub Pages
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}
repository: ${{ env.NOP_SITE_REPO_GITHUB }}
directory: nop-site-github
force: true
deploy-to-gitee-pages:
runs-on: ubuntu-latest
env:
NOP_SITE_REPO_GITEE: nop-platform/nop-platform.gitee.io
steps:
- name: Create temp dirs
run: mkdir project-docs nop-site-src nop-site-gitee
- 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_GITEE }}
persist-credentials: false
path: nop-site-gitee
- 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-gitee/projects/nop-entropy/docs
cp -rp project-docs/.knosys/sites/default/public/projects/nop-entropy/docs nop-site-gitee/projects/nop-entropy/docs
- name: Commit changes for Gitee Pages
run: |
cd nop-site-gitee
git config --local user.email "[email protected]"
git config --local user.name "Nop Assistant"
git add .
git commit -m "chore: deploy docs of project Nop Entropy via GitHub Actions"
cd ..
- name: Push changes for Gitee Pages
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}
repository: ${{ env.NOP_SITE_REPO_GITEE }}
directory: nop-site-gitee
force: true