-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.25 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
47 lines (37 loc) · 1.25 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
name: docs-deploy
on:
push:
branches: ['main', 'master']
permissions:
contents: write
concurrency:
group: docs-deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Safety check - only deploy from default branch
shell: bash
run: |
if [[ "${GITHUB_REF_NAME}" != "${{ github.event.repository.default_branch }}" ]]; then
echo "Error: docs-deploy must run from the default branch (${{ github.event.repository.default_branch }}), got ${GITHUB_REF_NAME}"
exit 1
fi
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: Install dependencies
working-directory: site-docs
run: pip install -r requirements.txt
- name: Configure git author
run: |
git config user.name github-actions
git config user.email github-actions@users.noreply.github.com
- name: Deploy docs to gh-pages
working-directory: site-docs
run: mkdocs gh-deploy --force