diff --git a/.github/workflows/push-doc-en.yml b/.github/workflows/push-doc-en.yml new file mode 100644 index 0000000..159eee6 --- /dev/null +++ b/.github/workflows/push-doc-en.yml @@ -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 < .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 git@github.com: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: 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