Skip to content

Commit

Permalink
Change to how images are pushed to GHCR.
Browse files Browse the repository at this point in the history
  • Loading branch information
knicholson32 committed Dec 22, 2023
1 parent cee7504 commit a2fb3b6
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: ci

on:
workflow_dispatch:
# push:
# branches:
# - "main"
push:
branches:
- "main"

jobs:
build:
Expand All @@ -14,7 +13,7 @@ jobs:
matrix:
platform:
- linux/amd64
- linux/arm64
# - linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -53,7 +52,9 @@ jobs:
REGISTRY_IMAGE=${{ vars.REGISTRY_IMAGE }}
CI=true
file: docker/Dockerfile
outputs: type=image,name=${{ vars.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
outputs: |
type=image,name=${{ vars.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
type=image,name=ghcr.io/${{ vars.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ vars.CACHE_REGISTRY_IMAGE }}:buildcache
cache-to: type=registry,ref=${{ vars.CACHE_REGISTRY_IMAGE }}:buildcache,mode=max
Expand Down Expand Up @@ -100,19 +101,14 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push DockerHub
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ vars.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image DockerHub
- name: Inspect image Docker Hub
run: |
docker buildx imagetools inspect ${{ vars.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
- name: Create manifest list and push ghcr.io
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ vars.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image ghcr.io
- name: Inspect image GHCR
run: |
docker buildx imagetools inspect ghcr.io/${{ vars.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

0 comments on commit a2fb3b6

Please sign in to comment.