Skip to content

Commit

Permalink
Update Container workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pgschk committed Jan 7, 2024
1 parent 13f1318 commit 533eaa3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ghcr publish
name: Container CI

on:
workflow_dispatch:
Expand All @@ -10,13 +10,9 @@ on:
branches: [ "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGES: |
docker.io/pgschk/alpine-toolkit
ghcr.io/pgschk/alpine-toolkit
TEST_TAG: test
jobs:
build:
Expand Down Expand Up @@ -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
Expand All @@ -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' }}
Expand Down

0 comments on commit 533eaa3

Please sign in to comment.