Skip to content

Update docker/build-push-action digest to ef1fb96 - autoclosed #551

Update docker/build-push-action digest to ef1fb96 - autoclosed

Update docker/build-push-action digest to ef1fb96 - autoclosed #551

name: GitHub CR Build and Push
on:
push:
branches: [ master ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 1 * *'
env:
REGISTRY: ghcr.io
# IMAGE_NAME: ${{ github.repository }}
# github.repository as <account>/<repo>
jobs:
buildPush:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@3f1544eb9eff0b4d4d279b33f704a06fcf8d0e43
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@6d4b68b490aef8836e8fb5e50ee7b3bdfa5894f0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Kubectl Docker metadata
id: meta
uses: docker/metadata-action@418e4b98bf2841bd337d0b24fe63cb36dc8afa55
with:
images: ${{ env.REGISTRY }}/${{ github.actor }}/alpinekube
- name: Build and Push Kubectl Docker image
id: build-and-push
uses: docker/build-push-action@ef1fb9688fc3626d0fd5e462f502cbbdc6456feb
with:
context: samples/kubernetes/
file: samples/kubernetes/DockerKubeHelmAlpine.docker
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract PgClient Docker metadata
id: meta1
uses: docker/metadata-action@418e4b98bf2841bd337d0b24fe63cb36dc8afa55
with:
images: ${{ env.REGISTRY }}/${{ github.actor }}/alpine-pgclient
- name: Build and Push PgClient Docker image
id: build-and-push1
uses: docker/build-push-action@ef1fb9688fc3626d0fd5e462f502cbbdc6456feb
with:
context: samples/adhoc-examples/
file: samples/adhoc-examples/DockerPgClient.docker
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta1.outputs.tags }}
labels: ${{ steps.meta1.outputs.labels }}
- name: Extract AWS Docker metadata
id: metaaws
uses: docker/metadata-action@418e4b98bf2841bd337d0b24fe63cb36dc8afa55
with:
images: ${{ env.REGISTRY }}/${{ github.actor }}/aws-cli-cdk
- name: Build and Push AWS Docker image
id: build-and-push2
uses: docker/build-push-action@ef1fb9688fc3626d0fd5e462f502cbbdc6456feb
with:
context: samples/aws/
file: samples/aws/aws-cli-cdk.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metaaws.outputs.tags }}
labels: ${{ steps.metaaws.outputs.labels }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PWD }}
- name: Build and push Kube image to Dockerhub
uses: docker/build-push-action@v6
with:
context: samples/kubernetes/
file: samples/kubernetes/DockerKubeHelmAlpine.docker
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER }}/alpinekube
- name: Build and push email image Dockerhub
uses: docker/build-push-action@v6
with:
context: samples/use-cases/postfix-email-relay/
file: samples/use-cases/postfix-email-relay/emailServer.docker
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER }}/postfixmailrelay
- name: Build and push Pgclient image to Dockerhub
uses: docker/build-push-action@v6
with:
context: samples/adhoc-examples/
file: samples/adhoc-examples/DockerPgClient.docker
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER }}/alpine-pgclient
- name: Build and push AWS image to Dockerhub
uses: docker/build-push-action@v6
with:
context: samples/aws/
file: samples/aws/aws-cli-cdk.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER }}/aws-cli-cdk