commit: 9b60a58e6b78d12d82afe857b8bb9649176542b8
Author: John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 8 04:34:52 2024 +0000
Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Thu Feb 8 04:48:02 2024 +0000
URL: https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=9b60a58e
actions: also push to Dockerhub on push
Limiting Dockerhub pushes to "scheduled" Actions runs was intended to
prevent these bits from running in PRs, but we also want changes to be
applied for regular pushes to the repository, so we allow 'push'. To
avoid this failing in forks without the requisite secrets, we also
limit these to repositories in Gentoo's namespace.
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
.github/actions/container_build/action.yml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/.github/actions/container_build/action.yml
b/.github/actions/container_build/action.yml
index bef1441..f4f2378 100644
--- a/.github/actions/container_build/action.yml
+++ b/.github/actions/container_build/action.yml
@@ -34,12 +34,16 @@ runs:
run: docker run --rm "${ORG}/${TARGET/-/:}" emerge --info
- name: Login to DockerHub
uses: docker/login-action@v2
- if: github.event_name == 'schedule'
+ if: |
+ github.repository_owner == 'gentoo' &&
+ (github.event_name == 'schedule' || github.event_name == 'push')
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_password }}
- name: Push image
- if: github.event_name == 'schedule'
+ if: |
+ github.repository_owner == 'gentoo' &&
+ (github.event_name == 'schedule' || github.event_name == 'push')
shell: bash
env:
DOCKER_CLI_EXPERIMENTAL: enabled