-
Notifications
You must be signed in to change notification settings - Fork 45
54 lines (48 loc) · 1.54 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
name: Publish docs
on:
push:
tags: # See PEP 440 for valid version format
- "*.*.*" # For docs bump, use workflow_dispatch
branches:
- test_branch
workflow_dispatch: # Manually trigger with 'Run workflow' button
permissions:
contents: write
pull-requests: write
issues: write
repository-projects: write
jobs:
deploy:
runs-on: ubuntu-latest
env:
REPO_OWNER: ${{ github.repository_owner }}
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Git describe # Get tags
id: ghd # see Deploy below. Will fail if no tags on branch
uses: proudust/gh-describe@v2
- name: Set up Python runtime
uses: actions/setup-python@v5
with:
python-version: 3.9
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup - pip & config
run: |
pip install .[docs]
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Deploy
run: | # github.ref_name is branch name if dispatch
FULL_VERSION=${{ steps.ghd.outputs.tag }}
export MAJOR_VERSION=${FULL_VERSION:0:3}
echo "OWNER: ${REPO_OWNER}. BUILD: ${MAJOR_VERSION}"
bash ./docs/build-docs.sh push $REPO_OWNER
env:
USERNAME: github-actions[bot]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}