forked from FAIR-by-Design-Methodology/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.31 KB
/
commit-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
name: Publish as Git Book on GitHub Pages
on:
workflow_dispatch:
workflow_call:
push:
branches:
- "main"
paths:
- "resources/**"
- "mkdocs.yml"
- "requirements.txt"
- "RELEASE_NOTES.md"
jobs:
signposting:
uses: ./.github/workflows/signposting.yml
deploy_docs:
name: Deploy docs
runs-on: ubuntu-22.04
needs: signposting
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: 'pip'
cache-dependency-path: requirements.txt
python-version: '3.9'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy with mike
run: |
mike deploy --rebase --push --update-aliases latest
git checkout gh-pages
git cat-file -e gh-pages:index.html 2> /dev/null && echo "Default version already set. Skipping..." || (echo "Setting default version..." && git checkout main && mike set-default --rebase --push latest)