-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.46 KB
/
Copy pathsync-docs.yml
File metadata and controls
44 lines (38 loc) · 1.46 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
name: Sync Docs (Reusable)
on:
workflow_call:
inputs:
repo-name:
description: "URL path segment for this project (defaults to the calling repo's name)"
required: false
type: string
default: ""
jobs:
sync:
name: Sync docs and rebuild site
runs-on: [self-hosted, docs]
permissions:
contents: read
deployments: write
environment:
name: docs-${{ inputs.repo-name || github.event.repository.name }}
url: https://docs.trickfirerobotics.com/${{ inputs.repo-name || github.event.repository.name }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v7
- name: Resolve repo name
id: name
run: |
NAME="${{ inputs.repo-name }}"
if [ -z "$NAME" ]; then
NAME="${{ github.event.repository.name }}"
fi
echo "value=$NAME" >> "$GITHUB_OUTPUT"
- name: Sync docs content
run: |
DEST="/home/trickfire/docs/content/${{ steps.name.outputs.value }}"
mkdir -p "$DEST"
rsync -av --delete --checksum docs/ "$DEST/"
cp docs.config.json "$DEST/docs.config.json"
- name: Rebuild and deploy docs site
run: bash /home/trickfire/docs/scripts/build.sh