-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.38 KB
/
flow-sync-doc.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
name: Flow sync-docs pipeline
on:
# To create the button that runs a workflow manually:
workflow_dispatch:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
# Write access is required later, so at least 1 way to allow it is under Settings/Actions/General
# set "Workflow permissions" to "Read and write permissions" (may need similar org-wide change first).
- name: Checkout Pages repo (the destination)
uses: actions/checkout@v4
with:
path: 'dst_repo'
- name: Checkout Code repo (the source)
uses: actions/checkout@v4
with:
repository: 'Flow-IPC/flow'
path: 'src_repo'
- name: Replace Pages (destination) docs with copy of Code (source) docs
run: |
cd dst_repo
DOC_DIR=doc/versions
BRANCH=main
rm -rf $DOC_DIR/$BRANCH
mkdir -p $DOC_DIR
cp -r ../src_repo/doc/flow_doc $DOC_DIR/$BRANCH
# These values informally recommended in:
# https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
git config user.name github-actions
git config user.email github-actions@github.com
git rm -r --cached $DOC_DIR/$BRANCH || echo "No [$DOC_DIR/$BRANCH] currently checked in; no problem."
git add $DOC_DIR/$BRANCH
git commit -m 'Sync documentation from code repo to Pages repo.'
git push origin main