Skip to content

Commit

Permalink
multiple hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg committed Feb 26, 2024
1 parent 1bc157a commit 817483d
Showing 1 changed file with 33 additions and 21 deletions.
54 changes: 33 additions & 21 deletions .github/workflows/alpine-mainline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ jobs:
# with:
# registry: public.ecr.aws

# - name: Login to Docker Hub
# # if: ${{ github.event_name != 'pull_request' }}
# uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Docker Hub
# if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
# if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -88,20 +88,21 @@ jobs:
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: |
ghcr.io/nginxinc/nginx-unprivileged
tags: |
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-slim-test
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-slim-test
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-slim-test
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine${{ needs.version.outputs.distro }}-slim-test
type=raw,value=${{ needs.version.outputs.major }}-alpine-slim-test
type=raw,value=${{ needs.version.outputs.major }}-alpine${{ needs.version.outputs.distro }}-slim-test
type=raw,value=mainline-alpine-slim-test
type=raw,value=mainline-alpine${{ needs.version.outputs.distro }}-slim-test
type=raw,value=alpine-slim-test
type=raw,value=alpine${{ needs.version.outputs.distro }}-slim-test
# with:
# images: |
# docker.io/nginxinc/nginx-unprivileged
# ghcr.io/nginxinc/nginx-unprivileged
# tags: |
# type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-slim-test
# type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-slim-test
# type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-slim-test
# type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine${{ needs.version.outputs.distro }}-slim-test
# type=raw,value=${{ needs.version.outputs.major }}-alpine-slim-test
# type=raw,value=${{ needs.version.outputs.major }}-alpine${{ needs.version.outputs.distro }}-slim-test
# type=raw,value=mainline-alpine-slim-test
# type=raw,value=mainline-alpine${{ needs.version.outputs.distro }}-slim-test
# type=raw,value=alpine-slim-test
# type=raw,value=alpine${{ needs.version.outputs.distro }}-slim-test

- name: Build and push NGINX mainline slim Alpine image to Amazon ECR Public Gallery, Docker Hub, GitHub Container Registry, and Quay
id: build
Expand All @@ -111,7 +112,7 @@ jobs:
context: "{{ defaultContext }}:mainline/alpine-slim"
# tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=ghcr.io/nginxinc/nginx-unprivileged,push-by-digest=true,name-canonical=true,push=true
outputs: type=image,name=ghcr.io/nginxinc/nginx-unprivileged,name=docker.io/nginxinc/nginx-unprivileged,push-by-digest=true,name-canonical=true,push=true
# push: ${{ github.event_name != 'pull_request' }}
# cache-from: type=gha,scope=alpine-slim
# cache-to: type=gha,mode=min,scope=alpine-slim
Expand Down Expand Up @@ -157,6 +158,7 @@ jobs:
with:
images: |
ghcr.io/nginxinc/nginx-unprivileged
docker.io/nginxinc/nginx-unprivileged
tags: |
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-slim-test
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-slim-test
Expand All @@ -169,6 +171,13 @@ jobs:
type=raw,value=alpine-slim-test
type=raw,value=alpine${{ needs.version.outputs.distro }}-slim-test
- name: Login to Docker Hub
# if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
# if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
Expand All @@ -182,10 +191,13 @@ jobs:
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/nginxinc/nginx-unprivileged@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'docker.io/nginxinc/nginx-unprivileged@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ghcr.io/nginxinc/nginx-unprivileged:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect docker.io/nginxinc/nginx-unprivileged:${{ steps.meta.outputs.version }}
# - name: Sign Docker Hub Manifest
# if: ${{ github.event_name != 'pull_request' }}
Expand Down

0 comments on commit 817483d

Please sign in to comment.