-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.19 KB
/
docs.yaml
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
name: Update documentation
on:
push:
branches:
- main
paths:
- docs/**
jobs:
docs:
runs-on: ubuntu-20.04
env:
DOCS_REPO: netsoc/docs
DOCS_SUBDIR: gitops
steps:
- name: Checkout main repo
uses: actions/checkout@v2
with:
path: main
- name: Checkout docs repo
uses: actions/checkout@v2
with:
repository: ${{ env.DOCS_REPO }}
persist-credentials: false
fetch-depth: 0
path: docs
- name: Update docs in docs repo
run: |
rm -rf "./docs/$DOCS_SUBDIR/"
# Would use -a, but we want to dereference symlinks
cp -rpL ../main/docs/ "./docs/$DOCS_SUBDIR/"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update ${{ github.repository }} documentation ($(echo ${{ github.sha }} | cut -c 1-8))"
working-directory: docs
- name: Push updated docs
uses: ad-m/github-push-action@master
with:
directory: docs
repository: ${{ env.DOCS_REPO }}
github_token: ${{ secrets.CI_PAT }}