generated from athackst/vscode_ros2_workspace
-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (131 loc) · 4.59 KB
/
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
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
name: Docs Site
on:
push:
branches:
- main
pull_request:
# default types and closed
types: [opened, synchronize, reopened, closed]
workflow_dispatch:
jobs:
# https://github.com/nosborn/github-action-markdown-cli
markdownlint:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout workspace
uses: actions/checkout@v4
- name: Run linter
uses: nosborn/[email protected]
with:
config_file: .markdownlint.json
files: .
dot: true
# https://github.com/gaurav-nelson/github-action-markdown-link-check
markdown-link-check:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout workspace
uses: actions/checkout@v4
- name: Run linter
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .markdown-link-check.json
folder-path: .
markdown-link-redirection-check:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Check links to external sites redirect to a new tab
uses: ./.github/actions/docs-lint/
env:
ROOT: './docs/'
docs-build:
name: Build Docs
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.action != 'closed'
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
with:
# checkout all commits to get accurate page revision times
# for the git-revision-date-localized plugin
fetch-depth: '0'
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.x"
- name: Install OS Dependencies
run: sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- name: Install Python dependencies
run: pip install -Ur docs/requirements.txt
- name: "Build docs"
run: mkdocs build
# https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
docs-deploy:
name: Deploy Docs version
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.action != 'closed'
needs: [docs-build]
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
# checkout all commits to get accurate page revision times
# for the git-revision-date-localized plugin
fetch-depth: '0'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install OS Dependencies
run: sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- name: Install Python dependencies
run: pip install -Ur docs/requirements.txt
- name: "Deploy pr-${{ github.event.number }} version of the Docs"
if: github.event_name == 'pull_request'
run: |
git config user.name ci-bot
git config user.email [email protected]
mike deploy --push pr-${{ github.event.number }}
- name: Deploy main version of the Docs
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
git config user.name ci-bot
git config user.email [email protected]
mike deploy --push --update-aliases main latest
docs-delete:
name: Delete Docs version
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
# checkout all commits to get accurate page revision times
# for the git-revision-date-localized plugin
fetch-depth: '0'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install OS Dependencies
run: sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- name: Install Python dependencies
run: pip install -Ur docs/requirements.txt
- name: "Delete pr-${{ github.event.number }} version of the Docs"
run: |
git config user.name ci-bot
git config user.email [email protected]
mike delete --push pr-${{ github.event.number }}