-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (56 loc) · 1.94 KB
/
generate-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
name: generate-doc
on:
release:
types: [published]
jobs:
generate-doc:
runs-on: macos-11
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: master
- name: Get tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
working-directory: master
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Build doc
env:
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
run: |
bundle install
bundle exec jazzy --clean --output .build/jazzy --author 'Outblock Team' --author_url https://github.com/outblock/flow-swift --github_url https://github.com/outblock/flow-swift --github-file-prefix https://github.com/outblock/flow-swift/tree/${RELEASE_VERSION} --module-version ${RELEASE_VERSION} --exclude 'Sources/Flow/Protobuf/*'
working-directory: master
- name: Checkout doc
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- name: Clean old doc
run: rm -rf docs/current
working-directory: gh-pages
- name: Copy new doc
env:
G_WORKSPACE: ${{github.workspace}}
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
run: |
mkdir -p docs/current
mkdir -p docs/$RELEASE_VERSION
cp -R ${G_WORKSPACE}/master/.build/jazzy/* docs/current
cp -R ${G_WORKSPACE}/master/.build/jazzy/* docs/$RELEASE_VERSION
working-directory: gh-pages
- name: Commit
env:
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "generate ${RELEASE_VERSION} docs automatically"
git push
working-directory: gh-pages