blob: 57e0ee776f9312f8331c625c22c6ec9e11f5aa66 [file] [log] [blame]
Davide Pesavento6b2bb622023-01-12 22:00:44 -05001name: Publish
2on:
3 push:
4 branches:
5 - master
6 paths-ignore:
7 - '.mailmap'
8 - 'README.md'
9 workflow_dispatch:
10
11permissions:
12 contents: read
13
14jobs:
15 HTML:
16 runs-on: ubuntu-latest
17 concurrency: docs.named-data.net
18 environment:
19 name: docs.named-data.net
20 url: https://docs.named-data.net/NDN-packet-spec/${{ steps.version.outputs.version }}/
21 steps:
22 - name: Checkout
23 uses: actions/checkout@v3
24 - name: Extract version
25 id: version
26 run: |
27 v=$(sed -nE "s/^version\s*=\s*['\"]([0-9]+(\.[0-9]+){0,3})['\"]/\1/p" conf.py)
28 if [[ -z $v ]]; then
29 echo "::error::Could not find a valid version in conf.py"
30 exit 1
31 fi
32 echo "::notice::Publishing version $v"
33 echo "version=$v" >> $GITHUB_OUTPUT
34 - name: Set up Python
35 uses: actions/setup-python@v4
36 with:
37 python-version: '3.10'
38 - name: Install dependencies
39 run: |
40 python -m pip install --upgrade pip
41 pip install -r requirements.txt
42 - name: Generate HTML pages
43 run: make html
44 env:
45 SPHINXOPTS: --color
46 - name: Publish HTML pages
47 uses: easingthemes/ssh-deploy@v4
48 with:
49 ARGS: -chirvEW --delay-updates --delete-delay
50 REMOTE_HOST: ${{ vars.DOCS_DEPLOYMENT_HOST }}
51 REMOTE_PORT: ${{ secrets.DOCS_DEPLOYMENT_PORT }}
52 REMOTE_USER: ${{ secrets.DOCS_DEPLOYMENT_USER }}
53 SSH_PRIVATE_KEY: ${{ secrets.DOCS_DEPLOYMENT_SSH_KEY }}
54 SOURCE: _build/html/
55 TARGET: /srv/docs/NDN-packet-spec/${{ steps.version.outputs.version }}/