-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (52 loc) · 2.3 KB
/
website_build.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
name: PugSharp_website_build
on:
push:
branches: [ main ]
tags: [ v**]
paths:
- 'Docs/**'
- 'packaging/Docs/**'
- '.github/workflows/website_build.yml'
pull_request:
branches:
- main
- develop
- 'feature/**'
tags: [ v**]
paths:
- 'Docs/**'
- 'packaging/Docs/**'
- '.github/workflows/website_build.yml'
jobs:
build_only:
runs-on: ubuntu-latest
if: ${{ ((!startsWith(github.ref, 'refs/tags/v')) && (!contains(github.event.head_commit.message, 'forcepublish')) && github.event_name == 'pull_request') || (((!startsWith(github.ref, 'refs/tags/v')) && (!contains(github.event.head_commit.message, 'forcepublish')) && github.event_name == 'push' )) }}
steps:
- uses: actions/checkout@v3
- name: build
run: docker run --rm -v ${{ github.workspace }}/Docs:/docs -e USERID=$(id -u ${USER}) -e GROUPID=$(id -g ${USER}) lan2play/docker-sphinxbuild:latest
publish_prd:
runs-on: ubuntu-latest
if: ${{ (startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push') || (contains(github.event.head_commit.message, 'forcepublish') && github.event_name == 'push') }}
steps:
- uses: actions/checkout@v3
- name: build
run: docker run --rm -v ${{ github.workspace }}/Docs:/docs -e USERID=$(id -u ${USER}) -e GROUPID=$(id -g ${USER}) lan2play/docker-sphinxbuild:latest
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PUGSHARP_LAN2PLAY_DE_SSH }}
name: id_rsa
# config: ${{ secrets.SSH_CONFIG }}
known_hosts: unnecessary
if_key_exists: fail
- name: git config
run: git config --global user.email "[email protected]" && git config --global user.name "PugSharp CI"
- name: clone pages repo
run: git clone [email protected]:Lan2Play/pugsharp.lan2play.de.git
- name: remove old things and add new
run: rm -rf ./pugsharp.lan2play.de/docs/* && cp -rf ./Docs/build/html/* ./pugsharp.lan2play.de/docs/
- name: readd cname and nojekyll
run: echo "pugsharp.lan2play.de" >> ./pugsharp.lan2play.de/docs/CNAME ; touch ./pugsharp.lan2play.de/docs/.nojekyll
- name: push pages repo
run: cd ./pugsharp.lan2play.de && if [ $(git status --short | wc -l) -gt 0 ]; then git add . && git commit -m "CI Build" && git push; fi