-
Notifications
You must be signed in to change notification settings - Fork 21
55 lines (45 loc) · 1.29 KB
/
update-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
51
52
53
54
55
---
name: Update Documentation
on:
push:
paths:
- "docs/**"
workflow_dispatch:
jobs:
update-docs:
runs-on: self-hosted
steps:
- name: Prepare environment
env:
GITHUB_KEY: ${{ secrets.DOCS_DEPLOY_SECRET }}
run: |
mkdir -p ${HOME}/.ssh || true
chmod 700 ${HOME}/.ssh || exit 1
cat <<EOF>${HOME}/.ssh/github
${GITHUB_KEY}
EOF
chmod 600 ${HOME}/.ssh/github
cat <<EOF>${HOME}/.ssh/config
Host github
Hostname github.com
IdentityFile ~/.ssh/github
User git
EOF
chmod 600 ${HOME}/.ssh/config
ssh-add ~/.ssh/github
- name: debug
run: |
cat ~/.ssh/config
- name: Update docs repository
run: |
git clone git@github:s3gw-tech/s3gw-docs.git docs.git || exit 1
pushd docs.git || exit 1
git config user.name "s3gw.tech github bot" || exit 1
git config user.email "bot@s3gw.tech" || exit 1
pushd s3gw || exit 1
git remote update origin
git checkout origin/main
popd || exit 1
git add s3gw || exit 1
git commit -m "docs: update s3gw to current main" || exit 1
git push || exit 1