Skip to content

Commit

Permalink
Tidy up action a little, add in missing GHCR meta
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
  • Loading branch information
PromoFaux committed Jul 3, 2023
1 parent 38bd862 commit 67fc0a4
Showing 1 changed file with 11 additions and 31 deletions.
42 changes: 11 additions & 31 deletions .github/workflows/v6-alpine-play.yml
Expand Up @@ -21,10 +21,6 @@ jobs:
container: alpine:3.18
- platform: linux/386
container: alpine:3.18
# - platform: linux/arm/v5
# container: debian:stretch-slim
# - platform: linux/arm/v6
# container: debian:bullseye-slim
- platform: linux/arm/v6
container: alpine:3.18
- platform: linux/arm/v7
Expand All @@ -38,6 +34,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: v6-alpine-play

- name: Docker meta (Docker Hub and GitHub Container Registry)
id: meta
uses: docker/metadata-action@v4
Expand All @@ -50,13 +47,15 @@ jobs:
latest=false
tags: |
v6-alpine-play
- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo
with:
docker_username: ${{ secrets.DOCKERHUB_USER }}
docker_password: ${{ secrets.DOCKERHUB_PASS }}
ghcr_username: ${{ github.repository_owner }}
ghcr_password: ${{ secrets.GITHUB_TOKEN }}

- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
Expand All @@ -65,6 +64,7 @@ jobs:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build container and push by digest (Docker Hub)
id: build_docker
uses: docker/build-push-action@v3
Expand All @@ -78,6 +78,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
outputs: |
type=image,name=${{ env.DOCKER_REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Build container and push by digest (GitHub Container Registry)
id: build_ghcr
uses: docker/build-push-action@v3
Expand All @@ -91,6 +92,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
outputs: |
type=image,name=${{ env.GITHUB_REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digests
run: |
mkdir -p /tmp/digests/dockerhub/${{ env.context }}
Expand All @@ -99,6 +101,7 @@ jobs:
touch "/tmp/digests/dockerhub/${{ env.context }}/${digest_docker#sha256:}"
digest_ghcr="${{ steps.build_ghcr.outputs.digest }}"
touch "/tmp/digests/ghcr/${{ env.context }}/${digest_ghcr#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
Expand All @@ -117,13 +120,16 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo
with:
Expand All @@ -139,6 +145,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: |
${{ env.DOCKER_REGISTRY_IMAGE }}
${{ env.GITHUB_REGISTRY_IMAGE }}
flavor: |
latest=false
tags: |
Expand All @@ -163,30 +170,3 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.GITHUB_REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
# Push the digests to Docker Hub and GitHub Container Registry

# -
# name: Collect and push (Alpine, Docker Hub)
# uses: ./.github/actions/merge-and-push
# with:
# imagename: ${{ env.DOCKER_REGISTRY_IMAGE }}
# platform: alpine
# # -
# # name: Collect and push (Debian, Docker Hub)
# # uses: ./.github/actions/merge-and-push
# # with:
# # imagename: ${{ env.DOCKER_REGISTRY_IMAGE }}
# # platform: debian
# -
# name: Collect and push (Alpine, GitHub Container Registry)
# uses: ./.github/actions/merge-and-push
# with:
# imagename: ${{ env.GITHUB_REGISTRY_IMAGE }}
# platform: alpine
# -
# name: Collect and push (Debian, GitHub Container Registry)
# uses: ./.github/actions/merge-and-push
# with:
# imagename: ${{ env.GITHUB_REGISTRY_IMAGE }}
# platform: debian

0 comments on commit 67fc0a4

Please sign in to comment.