From 9b60a58e6b78d12d82afe857b8bb9649176542b8 Mon Sep 17 00:00:00 2001 From: John Helmert III Date: Wed, 7 Feb 2024 20:34:52 -0800 Subject: 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 --- .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 -- cgit v1.2.3-65-gdbad