diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index f394fa2..ed3e57e 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -1,4 +1,4 @@ -name: ghcr publish +name: Container CI on: workflow_dispatch: @@ -10,13 +10,9 @@ on: branches: [ "main" ] env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / IMAGES: | docker.io/pgschk/alpine-toolkit ghcr.io/pgschk/alpine-toolkit - TEST_TAG: test jobs: build: @@ -97,6 +93,19 @@ jobs: run: | buildah push ${{ steps.build_image.outputs.image-with-tag }} docker-daemon:${{ steps.build_image.outputs.image-with-tag }} + - name: Log in to docker.io + uses: redhat-actions/podman-login@v1 + with: + registry: docker.io + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_LOGIN }} + - name: Log in to ghcr.io + uses: redhat-actions/podman-login@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in, # in which case 'username' and 'password' can be omitted. - name: Push To ghcr.io @@ -106,9 +115,6 @@ jobs: with: image: ${{ steps.build_image.outputs.image }} tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Print ghcr.io image url if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}