-
Notifications
You must be signed in to change notification settings - Fork 27
78 lines (75 loc) · 3.02 KB
/
deploy-doc.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Deploy doc
on:
workflow_call:
inputs:
doc-version:
description: "version of the library for which we are deploying the doc. If empty, then it is main branch doc."
required: FALSE
default: ""
type: string
doc-clean:
description: "Whether the previous doc should be cleaned. (Always ignore subfolders in version/)"
required: FALSE
default: "true"
type: string
doc-artifact-name:
description: "Name of the artifact containing the built doc"
required: false
default: "doc"
type: string
doc-path:
description: "Path where to extract the built doc"
required: false
default: "docs/.vuepress/dist"
type: string
binder-env-fullref:
description: "Full ref of the binder env to build. The build is triggered only if not empty."
required: false
default: ""
type: string
jobs:
trigger-binder-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # checkout triggering branch to get scripts/trigger_binder.sh
- name: Trigger a build for default binder env ref on each BinderHub deployments in the mybinder.org federation
continue-on-error: true
run: |
binder_env_full_ref=${{ inputs.binder-env-fullref }}
if [ -z "${binder_env_full_ref}" ]; then
binder_env_full_ref="${{ github.repository }}/${{ github.ref_name}}"
fi
echo Triggering binder environment build for ${binder_env_full_ref}
bash scripts/trigger_binder.sh https://ovh.mybinder.org/build/gh/${binder_env_full_ref}
bash scripts/trigger_binder.sh https://ovh2.mybinder.org/build/gh/${binder_env_full_ref}
bash scripts/trigger_binder.sh https://notebooks.gesis.org/binder/build/gh/${binder_env_full_ref}
deploy-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.doc-artifact-name }}
path: ${{ inputs.doc-path }}
- name: set doc-version-path
id: set-doc-version-path
run: |
doc_version=${{ inputs.doc-version }}
if [ -z "${doc_version}" ]; then
doc_version_path="/"
else
doc_version_path="/version/${doc_version}/"
fi
echo "doc_version_path=${doc_version_path}" >> $GITHUB_OUTPUT
- name: Deploy documentation in a version subfolder on GH pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{ inputs.doc-path }} # The folder the action should deploy.
target-folder: ${{ steps.set-doc-version-path.outputs.doc_version_path }} # The folder the action should deploy to.
commit-message: publish documentation
single-commit: true
clean: ${{ inputs.doc-clean }}
clean-exclude: |
"version/*"