-
Notifications
You must be signed in to change notification settings - Fork 6
74 lines (64 loc) · 2.04 KB
/
docs.yaml
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
name: Docs Site
on:
push:
branches:
- main
paths:
- 'doc-site/docs/**'
pull_request:
paths:
- 'doc-site/docs/**'
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
env:
LATEST_TAG: ""
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
check-latest: true
cache-dependency-path: |
**/*.sum
- name: Setup Docs Deploy
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Get the latest tag
run: |
git fetch --tags
latest_tag=$(git tag -l | sort -V | grep -v "rc" | tail -n 1)
echo "latest tag: $latest_tag"
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
- name: Install docs dependencies
working-directory: doc-site
run: pip install -r requirements.txt
- name: Build CRD Reference Docs
working-directory: operator
run: make generate-reference-docs
- name: Update doc site for release
if: github.event.action == 'released' && github.ref_name != env.LATEST_TAG
working-directory: doc-site
run: mike deploy ${{ github.event.release.tag_name }} --push
- name: Update doc site for latest release
if: github.event.action == 'released' && github.ref_name == env.LATEST_TAG
working-directory: doc-site
run: mike deploy ${{ github.event.release.tag_name }} latest -u --push
- name: Update doc site for `main` branch
if: ${{ github.event_name == 'push' }}
working-directory: doc-site
run: mike deploy head --push
- name: Test building the doc site but do not deploy it
if: ${{ github.event_name == 'pull_request' }}
working-directory: doc-site
run: mkdocs build