-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (84 loc) · 2.82 KB
/
Copy pathdocs.yml
File metadata and controls
97 lines (84 loc) · 2.82 KB
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
name: Docs
on:
push:
branches: [main]
paths:
- docs/**
- mkdocs.yml
- .github/workflows/docs.yml
pull_request:
branches: [main]
paths:
- docs/**
- mkdocs.yml
- .github/workflows/docs.yml
workflow_dispatch:
concurrency:
group: pages
cancel-in-progress: false
permissions:
contents: read
jobs:
build:
name: Build docs
runs-on: ubuntu-24.04
steps:
- name: Harden runner
# renovate: datasource=github-tags depName=DevSecNinja/.github
uses: DevSecNinja/.github/actions/harden-runner@bf22fcfcb4ef94a359eed55cea4b5ce7f5b98167 # main
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.x'
- name: Install MkDocs Material
run: pip install mkdocs-material
- name: Build docs
run: mkdocs build --strict
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-24.04
needs: build
if: github.event_name == 'push'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Harden runner
# renovate: datasource=github-tags depName=DevSecNinja/.github
uses: DevSecNinja/.github/actions/harden-runner@bf22fcfcb4ef94a359eed55cea4b5ce7f5b98167 # main
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
# --- Page on main-branch docs-build/deploy failure (homelab IRM pager) ---
notify-irm:
name: Notify Grafana IRM
needs:
- build
- deploy
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Harden runner
# renovate: datasource=github-tags depName=DevSecNinja/.github
uses: DevSecNinja/.github/actions/harden-runner@bf22fcfcb4ef94a359eed55cea4b5ce7f5b98167 # main
- name: Notify Grafana IRM
uses: DevSecNinja/.github/.github/actions/notify-irm@b2509636243e456253c938184dfe1855d6401e6d # main
with:
webhook-url: ${{ secrets.GRAFANA_IRM_WEBHOOK_URL }}
# `needs.*.result` is system-controlled, safe to interpolate.
job-failed: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}