Skip to content

Commit

Permalink
workflow: push-doc-en
Browse files Browse the repository at this point in the history
  • Loading branch information
jkjkil4 committed May 31, 2024
1 parent 259d551 commit b6749bc
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/push-doc-en.yml
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

0 comments on commit b6749bc

Please sign in to comment.