-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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: Add remote and reset to it | ||
run: | | ||
git remote add doc-en [email protected]:jkjkil4/JAnim-doc-en.git | ||
git fetch doc-en | ||
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: 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: 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 |