-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (101 loc) · 3.57 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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