-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (60 loc) · 1.56 KB
/
push-doc-en.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Push docs (en)
on:
push:
branches:
- docs-en
jobs:
push-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update .gitignore
run: |
cat <<EOF > .gitignore
/*
!/doc
!/janim
/doc/build
/doc/source/locales/*
!/doc/source/locales/en
!/.gitignore
!/.readthedocs.yaml
!/pyproject.toml
__pycache__
EOF
- name: Debug .gitignore
run: cat .gitignore
- name: Setup SSH
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY_DOC_EN }}
run: |
mkdir -p ~/.ssh
echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Add remote and reset to it
run: |
git remote add doc-en [email protected]:jkjkil4/JAnim-doc-en.git
git fetch doc-en --depth 1
git reset remotes/doc-en/docs
- name: Debug remotes
run: git remote -v
- name: Debug branches
run: git branch -a
- name: Add files and reset README.md
run: |
git add .
git reset -q README.md
- name: Debug status
run: git status
- name: Check changes
run: |
if git diff --cached --exit-code; then
echo "No changes staged, exit with code 0"
exit 0
fi
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Sync JAnim"
git push doc-en docs-en:refs/heads/docs