-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (81 loc) · 2.84 KB
/
publish_docs.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
name: Publish Docs
on:
push:
branches: ['main']
release:
types: [published]
permissions:
pull-requests: write
contents: write
pages: write
id-token: write
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- name: Add Dependencies
run: sudo apt-get update && sudo apt-get install -y portaudio19-dev build-essential libpulse-dev libdbus-1-dev g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- name: get latest release with tag
id: latestrelease
run: |
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/lee-orr/dexterous_developer/releases | jq '.[] | .tag_name | select(. | test("^.*\\d+\\.\\d+\\.\\d+$"))' | sed 's/\"//g' | head -n1)"
- name: confirm release tag
run: |
echo Release ${{ steps.latestrelease.outputs.releasetag }}
- name: get latest pre-release with tag
id: latestprerelease
run: |
echo "::set-output name=prereleasetag::$(curl -s https://api.github.com/repos/lee-orr/dexterous_developer/releases | jq '.[0] | .tag_name' | sed 's/\"//g')"
- name: confirm pre-release tag
run: |
echo Release ${{ steps.latestprerelease.outputs.prereleasetag }}
- name: setup out dir
run: |
mkdir ../book
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'main'
- run: mdbook build
- name: place files in folder
run: |
mv ./book ../book/main
- name: tagcheckout
uses: actions/checkout@v2
with:
ref: ${{ steps.latestprerelease.outputs.prereleasetag }}
- run: mdbook build
- name: place files in folder
run: |
mv ./book ../book/pre
- name: tagcheckout
uses: actions/checkout@v2
with:
ref: ${{ steps.latestrelease.outputs.releasetag }}
- run: mdbook build
- name: place files in folder
run: |
mv ./book/* ../book/
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "../book"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1