-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (61 loc) · 2.07 KB
/
docs_manual.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
name: Manually Deploy Docs
on:
workflow_dispatch:
inputs:
release:
required: true
description: 'Release number'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Dependencies
continue-on-error: true
run: | # We install documentation.js globally so that we can use `documentation` instead of `node_modules/.../documentation`.
npm install
- name: Generate Docs
run: |
npm run docs:build
- name: Commit changes
continue-on-error: true
run: |
git config user.name github-actions
git config user.email [email protected]
git add ./docs/
git commit -m "New docs"
git push --set-upstream origin main
git reset --hard
- name: Deploy to gh pages
run: |
git fetch
git checkout gh-pages
git pull origin gh-pages
rm -rf latest/
git checkout main -- docs/.vuepress/dist/
rm -rf ${{ github.event.inputs.release }}
mkdir ${{ github.event.inputs.release }}
mkdir latest
mv docs/.vuepress/dist/* ${{ github.event.inputs.release }}
grep -rl '/latest' ./${{ github.event.inputs.release }} | xargs sed -i 's+/latest+/${{ github.event.inputs.release }}+g'
rm -rf docs/
git checkout main -- docs/.vuepress/dist/
mv docs/.vuepress/dist/* ./latest/
rm -rf docs/
git checkout main -- demo/
git checkout main -- web/
git checkout main -- tests/
echo "https://epi.js.org" > CNAME
echo "" > .nojekyll
- name: Push changes
continue-on-error: true
run: |
git switch gh-pages
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New docs"
git push --set-upstream origin gh-pages