Skip to content

Commit

Permalink
Merge pull request #1390 from mathbunnyru/asalikhov/github_action_for…
Browse files Browse the repository at this point in the history
…_push

Use stefanzweifel/git-auto-commit-action to push to github
  • Loading branch information
mathbunnyru committed Jun 27, 2021
2 parents bd8ffe6 + 93726ef commit 73a43d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 26 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@5dd17c3b53a58c1cb5eaab903826abe94765ccd6 # dependabot updates to latest release
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
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@5dd17c3b53a58c1cb5eaab903826abe94765ccd6 # dependabot updates to latest release
with:
commit_message: "[ci skip] Automated publish for ${{github.sha}}"
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)" && \
Expand Down

0 comments on commit 73a43d8

Please sign in to comment.