Skip to content

Commit

Permalink
Push to both GHCR and Dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar authored Aug 14, 2023
1 parent 1d24908 commit d0002af
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/podman-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ on:
branches: [ "main", "staging", "develop", "sandbox" ]

env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io/avalonmediasystem
GHCR_USER: ${{ github.actor }}
GHCR_PASSWORD: ${{ github.token }}
GHCR_IMAGE_REGISTRY: ghcr.io/avalonmediasystem
DOCKERHUB_IMAGE_REGISTRY: docker.io/avalonmediasystem
DOCKERHUB_USER: ${{ secrets.dockerhub_user }}
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
IMAGE_TAG: ${{ fromJSON('{"refs/heads/main":"production","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }}
BRANCH: ${{ fromJSON('{"refs/heads/main":"main","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }}

Expand All @@ -27,14 +30,14 @@ jobs:
tags: ${{ env.IMAGE_TAG }} ${{ github.sha }}
containerfiles: ./Dockerfile
oci: true
- name: Push To Dockerhub
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.GHCR_IMAGE_REGISTRY }}
username: ${{ env.GHCR_USER }}
password: ${{ env.GHCR_PASSWORD }}
extra-args: |
--disable-content-trust
Expand All @@ -51,8 +54,8 @@ jobs:
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.determine_dockerhub_tags.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.DOCKERHUB_IMAGE_REGISTRY }}
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_PASSWORD }}
extra-args: |
--disable-content-trust

0 comments on commit d0002af

Please sign in to comment.