-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (56 loc) · 1.74 KB
/
build_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
name: Build and deploy doc
on:
release:
types: [created]
workflow_dispatch:
inputs:
version_name:
description: 'Version that will be used in version selector'
required: true
jobs:
build:
runs-on: ubuntu-latest
container:
image: wirepas/sdk-builder:v1.5
options: --user 0
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Generate doc
run: make doxygen target_board=pca10056
- name: Set folder for release
if: ${{ github.event_name == 'release' }}
run: echo "FOLDER=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Set folder for manual triggering
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "FOLDER=${{ github.event.inputs.version_name }}" >> $GITHUB_ENV
- name: Deploy doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
destination_dir: ${{ env.FOLDER }}
- name: Duplicate to latest folder too
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
destination_dir: 'latest'
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: 'gh-pages'
path: 'gh-pages'
- name: Add new version
run: sed -i "/^'latest'/i '${{ env.FOLDER }}'," gh-pages/select_version.js
- name: Publish change
uses: EndBug/add-and-commit@v5
with:
add: select_version.js
author_name: GH Action build_doc
author_email: [email protected]
branch: gh-pages
cwd: 'gh-pages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}