Skip to content

PUSH triggered by Github Actions #103

PUSH triggered by Github Actions

PUSH triggered by Github Actions #103

name: 'Build and publish docker images (all platforms)'
on: [push]
jobs:
release:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v4
with:
images: dersimn/helloarm # list of Docker images to use as base name for tags
tag-sha: false # add git short SHA as Docker tag, e.g.: sha-12affe0
tag-latest: false # disabled here for demonstration purposes
tag-semver: |
github-workflow-{{major}}
github-workflow-{{major}}.{{minor}}
github-workflow-{{major}}.{{minor}}.{{patch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v5.0.1
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Quay Registry
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_ROBOT }}
password: ${{ secrets.QUAY_IO_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
build-args: DNS=8.8.8.8
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm/v6,linux/arm64/v8
push: true
tags: ${{ secrets.DOCKER_HUB_REPO }}:latest
labels: ${{ steps.docker_meta.outputs.labels }}
- # copy multiplatform image from dockerhub to quay and ghcr
name: Push Image to multiple registries
uses: akhilerm/[email protected]
with:
src: docker.io/${{ secrets.DOCKER_HUB_REPO }}:latest
dst: |
quay.io/${{ secrets.DOCKER_HUB_REPO }}:latest
# quay.io/user/app:1.0.0
# ghcr.io/${{ secrets.DOCKER_TAG }}:latest
# ghcr.io/user/app:1.0.0
# - name: Update repo description
# uses: peter-evans/dockerhub-description@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: ${{ secrets.DOCKER_HUB_REPO }}
# - uses: meeDamian/[email protected]
# with:
# user: ${{ secrets.DOCKERHUB_USERNAME }}
# #pass: ${{ secrets.DOCKER_PASS }}
# pass: ${{ secrets.DOCKERHUB_TOKEN }}
# slug: packetworks/nxfilter-base
# readme: ./README.md