-
Notifications
You must be signed in to change notification settings - Fork 2.1k
60 lines (57 loc) · 1.74 KB
/
deploy-guides.yml
File metadata and controls
60 lines (57 loc) · 1.74 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
name: Deploy Guides to RIOT-OS.org Server
on:
push:
branches:
- master
paths:
- 'doc/guides/**'
- 'doc/starlight/**'
- 'CODE_OF_CONDUCT.md'
- 'GOVERNANCE.md'
- 'CONTRIBUTING.md'
- 'CODING_CONVENTIONS*.md'
- 'SECURITY.md'
- 'release-notes.txt'
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
secret-configured: ${{ steps.secret-exists-check.outputs.defined }}
steps:
- name: Check if Secret is configured
id: secret-exists-check
# check if the secrets are configured before running the tasks
# see: https://stackoverflow.com/a/70249520
shell: bash
run: |
if [ "${{ secrets.SSH_GUIDES_PRIVATE_KEY }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
deploy-guide:
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.secret-configured == 'true'
defaults:
run:
working-directory: doc/starlight
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '25.x'
- name: Build documentation
run: make build
- name: Deploy to riot-os.org server
uses: burnett01/rsync-deployments@v8
with:
switches: -avzr --delete
path: doc/starlight/dist/
remote_path: /
remote_host: ${{ secrets.SSH_GUIDES_REMOTE_HOST }}
remote_port: ${{ secrets.SSH_GUIDES_REMOTE_PORT }}
remote_user: ${{ secrets.SSH_GUIDES_REMOTE_USER }}
remote_key: ${{ secrets.SSH_GUIDES_PRIVATE_KEY }}