-
Notifications
You must be signed in to change notification settings - Fork 16
158 lines (150 loc) · 4.7 KB
/
doc.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# This workflow will check flake style
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Docs Deploy
on:
push:
# branches: [ main, 'doc/*', 'dev/*' ]
release:
types: [ published ]
jobs:
contents:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
strategy:
matrix:
python-version: [ 3.8 ]
services:
plantuml:
image: plantuml/plantuml-server:jetty-v1.2023.6
ports:
- 18080:8080
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 8
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 20
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: ${{ github.event_name == 'push' }}
run: |
sudo apt-get update -y
sudo apt-get install -y make wget curl cloc graphviz pandoc
dot -V
python -m pip install -r requirements.txt
python -m pip install -r requirements-doc.txt
- name: Prepare dataset
uses: nick-fields/retry@v2
if: ${{ github.event_name == 'push' }}
env:
CI: 'true'
HF_NARUGO_USERNAME: ${{ secrets.HF_NARUGO_USERNAME }}
HF_NARUGO_PASSWORD: ${{ secrets.HF_NARUGO_PASSWORD }}
with:
shell: bash
timeout_minutes: 20
max_attempts: 5
retry_on: any
command: |
make dataset
- name: Generate the contents
if: ${{ github.event_name == 'push' }}
env:
ENV_PROD: 'true'
PLANTUML_HOST: http://localhost:18080
run: |
plantumlcli -c
make docs
- name: Change Commit
if: ${{ github.event_name == 'push' }}
id: commit
run: |
git config user.name 'narugo1992'
git config user.email '[email protected]'
git add -A
git diff-index --quiet HEAD || git commit -a -m "dev(narugo): auto sync $(date -R)"
- name: Push changes
uses: ad-m/github-push-action@master
if: ${{ github.event_name == 'push' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
doc:
runs-on: ubuntu-latest
needs:
- contents
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
python-version: [ 3.8 ]
services:
plantuml:
image: plantuml/plantuml-server:jetty-v1.2023.6
ports:
- 18080:8080
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 8
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 20
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y make wget curl cloc graphviz pandoc
dot -V
python -m pip install -r requirements.txt
python -m pip install -r requirements-doc.txt
- name: Prepare dataset
uses: nick-fields/retry@v2
env:
CI: 'true'
HF_NARUGO_USERNAME: ${{ secrets.HF_NARUGO_USERNAME }}
HF_NARUGO_PASSWORD: ${{ secrets.HF_NARUGO_PASSWORD }}
with:
shell: bash
timeout_minutes: 20
max_attempts: 5
retry_on: any
command: |
make dataset
- name: Sync from ref
if: ${{ github.event_name == 'push' }}
run: |
git pull
- name: Generate
env:
ENV_PROD: 'true'
PLANTUML_HOST: http://localhost:18080
run: |
git fetch --all --tags
git branch -av
git remote -v
git tag
plantumlcli -c
make pdocs
mv ./docs/build/html ./public
- name: Deploy to Github Page
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_CONFIG_NAME: narugo1992
GIT_CONFIG_EMAIL: [email protected]
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: public # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch