-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (66 loc) · 2.02 KB
/
docs.yml
File metadata and controls
81 lines (66 loc) · 2.02 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
76
77
78
79
80
name: Publish Docs
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
build_docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: mamba-org/setup-micromamba@v2
with:
init-shell: bash
cache-downloads: true
- name: Checkout mapflpy
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install nox[pbs]
- name: Set nox conda backend
run: echo "CONDA_EXE=micromamba" >> "$GITHUB_ENV"
- name: Build docs
run: |
nox -s build_docs
- name: Upload docs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: docs
path: .nox/_artifacts/docs/html*/
retention-days: 7
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DOCS_SSH_KEY }}
known_hosts: "placeholder"
- name: Add known_hosts from target
env:
SSH_HOST: ${{ secrets.DOCS_SSH_HOST }}
SSH_PORT: ${{ secrets.DOCS_SSH_PORT }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -p "${SSH_PORT:-22}" -H "${SSH_HOST}" >> ~/.ssh/known_hosts
- name: Rsync to server
env:
SSH_HOST: ${{ secrets.DOCS_SSH_HOST }}
SSH_USER: ${{ secrets.DOCS_SSH_USER }}
SSH_PORT: ${{ secrets.DOCS_SSH_PORT }}
REMOTE_DIR: ${{ secrets.DOCS_SSH_PATH }}
run: |
# make sure remote dir exists
ssh -p "${SSH_PORT:-22}" "${SSH_USER}@${SSH_HOST}" "mkdir -p '${REMOTE_DIR}'"
rsync -rlvz \
--omit-dir-times --no-times \
--no-perms --no-owner --no-group \
-e "ssh -p ${SSH_PORT:-22}" \
.nox/_artifacts/docs/html*/ "${SSH_USER}@${SSH_HOST}:${REMOTE_DIR}/"