forked from scc-digitalhub/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-docs.yaml
More file actions
75 lines (75 loc) · 2.81 KB
/
deploy-docs.yaml
File metadata and controls
75 lines (75 loc) · 2.81 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
name: deploy-docs
run-name: Build and deploy docs
on: [push]
permissions:
contents: write
jobs:
deploy-current:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: pip install mkdocs-material
- run: |
git fetch --prune --unshallow --tags
echo ${{ github.event }}
echo ${{ github.event.action }}
echo ${{ github.action }}
git checkout main
export VERSIONS=$(echo `git branch -r --format='%(refname:short)'`|python versions_string.py)
cd user && mkdocs build && cd ..
cd dev && mkdocs build && cd ..
cd admin && mkdocs build && cd ..
mv user/site ./site
mv dev/site site/dev
mv admin/site site/admin
- run: |
git checkout gh-pages
cp -r site/* .
rm -r site
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com'
git add --all
git commit -m "Workflow docs - Current" --allow-empty
git push
deploy-versioned:
needs: deploy-current
if: github.ref_name != 'main' && github.ref_name != 'gh-pages'
runs-on: ubuntu-latest
env:
DOCS_VERSION: v:${{ github.ref_name }}
USER_STYLESHEETS_PORTAL_SELECTION: ../stylesheets/portal_selection.css
USER_STYLESHEETS_COLORS: ../stylesheets/colors.css
OTHERS_STYLESHEETS_PORTAL_SELECTION: ../../stylesheets/portal_selection.css
OTHERS_STYLESHEETS_COLORS: ../../stylesheets/colors.css
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: pip install mkdocs-material
- run: |
git fetch --prune --unshallow --tags
echo ${{ github.event }}
echo ${{ github.event.action }}
echo ${{ github.action }}
git checkout ${{ github.ref_name }}
export VERSIONS=$(echo `git branch -r --format='%(refname:short)'`|python versions_string.py)
cd user && mkdocs build && cd ..
cd dev && mkdocs build && cd ..
cd admin && mkdocs build && cd ..
mkdir ./site
mv user/site site/${{ github.ref_name }}
mv dev/site site/${{ github.ref_name }}/dev
mv admin/site site/${{ github.ref_name }}/admin
- run: |
git checkout gh-pages
cp -r site/* .
rm -r site
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com'
git add --all
git commit -m "Workflow docs - Versioned" --allow-empty
git push