-
Notifications
You must be signed in to change notification settings - Fork 301
79 lines (74 loc) · 2.18 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Documentation
on:
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
push:
branches:
- develop
- main
tags: '[0-9]+.[0-9]+.[0-9]+'
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
release:
types:
- created
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
build-command: make html dirhtml
- uses: actions/upload-artifact@v3
with:
name: documentation
path: docs/_build/html/
# Deployment job
deploy:
if: github.ref == 'refs/heads/develop'
environment:
name: documentation
url: "https://docs.artemis.cit.tum.de"
runs-on: ubuntu-latest
needs: docs
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: documentation
path: public
- name: Copy site to server
uses: appleboy/scp-action@master
with:
host: docs.artemis.cit.tum.de
username: ${{ secrets.DOCS_SSH_USER }}
key: ${{ secrets.DOCS_SSH_KEY }}
proxy_host: ${{ secrets.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ secrets.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ secrets.DEPLOYMENT_GATEWAY_PORT }}
source: "public"
target: ${{ secrets.DOCS_HOME }}
- name: Move site to www
uses: appleboy/ssh-action@master
with:
host: docs.artemis.cit.tum.de
username: ${{ secrets.DOCS_SSH_USER }}
key: ${{ secrets.DOCS_SSH_KEY }}
proxy_host: ${{ secrets.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ secrets.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ secrets.DEPLOYMENT_GATEWAY_PORT }}
script: |
rm -rf ${{ secrets.DOCS_WWW }}/*
mv -f public/* ${{ secrets.DOCS_WWW }}/