Use stefanzweifel/git-auto-commit-action to push to github

This commit is contained in:
Ayaz Salikhov
2021-06-27 17:10:37 +03:00
parent c65c56f8ae
commit 36b039f2ff
3 changed files with 7 additions and 26 deletions

View File

@@ -57,11 +57,10 @@ jobs:
run: make -C main hook-all
- name: Push Wiki to GitHub
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
# Pass GITHUB_REPOSITORY directly to avoid conflict with GitHub Actions built-in env var
run: make -C main git-commit GITHUB_REPOSITORY='${{github.repository}}.wiki'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
LOCAL_PATH: ../wiki
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci skip] Automated publish for ${{ GITHUB_SHA }}"
repository: ../wiki
- name: Login to Docker Hub
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
uses: docker/login-action@v1

View File

@@ -42,8 +42,6 @@ jobs:
sphinx-intl update -p ./_build/gettext -l en
- name: Push Strings to Master
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
run: make git-commit
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_REPOSITORY: ${{github.repository}}
LOCAL_PATH: ./docs/locale/en
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci skip] Automated publish for ${{ GITHUB_SHA }}"

View File

@@ -62,22 +62,6 @@ dev-env: ## install libraries required to build docs and run tests
docs: ## build HTML documentation
sphinx-build docs/ docs/_build/
git-commit: LOCAL_PATH?=.
git-commit: GITHUB_SHA?=$(shell git rev-parse HEAD)
git-commit: GITHUB_REPOSITORY?=jupyter/docker-stacks
git-commit: GITHUB_TOKEN?=
git-commit: ## commit outstading git changes and push to remote
@git config --global user.name "GitHub Actions"
@git config --global user.email "actions@users.noreply.github.com"
@echo "Publishing outstanding changes in $(LOCAL_PATH) to $(GITHUB_REPOSITORY)"
@cd $(LOCAL_PATH) && \
git remote add publisher https://$(GITHUB_TOKEN)@github.com/$(GITHUB_REPOSITORY).git && \
git checkout master && \
git add -A -- . && \
git commit -m "[ci skip] Automated publish for $(GITHUB_SHA)" || exit 0
@cd $(LOCAL_PATH) && git push -u publisher master
hook/%: WIKI_PATH?=../wiki
hook/%: ## run post-build hooks for an image
python3 -m tagging.tag_image --short-image-name "$(notdir $@)" --owner "$(OWNER)" && \