forked from kubernetes-client/python
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.19 KB
/
deploy-wiki.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
name: Deploy Wiki
on:
push:
paths:
- 'kubernetes/docs/**'
branches:
- master
workflow_dispatch:
jobs:
deploy-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rsync
id: install_rsync
run: |
sudo apt install rsync grsync
- name: Clone Wiki
id: clone_wiki
run: |
git config --global --add safe.directory "/github/workspace"
git config --global --add safe.directory "/github/workspace/wiki"
git clone https://github.com/kubernetes-client/python.wiki.git wiki
echo "message=$(git log -1 --format=%B)" >> $GITHUB_OUTPUT
- name: Copy to wiki repository
id: copy_to_wiki
run: |
rsync -av --delete kubernetes/docs/ wiki/ --exclude .git
- name: Push wiki
id: push_wiki
run: |
cd wiki
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "${{ steps.clone_wiki.outputs.message }}"
git push "https://${{ env.GITHUB_ACTOR }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.GITHUB_REPOSITORY }}.git"