Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: docker-image

on:
push:
tags:
- "*"
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
cache-from: type=registry,ref=${{ vars.DOCKERHUB_IMAGE }}:buildcache
cache-to: type=registry,ref=${{ vars.DOCKERHUB_IMAGE }}:buildcache,mode=max
push: true
tags: ${{ vars.DOCKERHUB_IMAGE }}:${{ github.sha }}
- name: Push "tag"
if: github.ref_type == 'tag'
run: |
GITHUB_REF=${{ github.ref }}
TAG=${GITHUB_REF#refs/tags/}
docker buildx imagetools create \
--tag ${{ vars.DOCKERHUB_IMAGE }}:${TAG} \
${{ vars.DOCKERHUB_IMAGE }}:${{ github.sha }}
- name: Push "latest"
if: github.ref == 'refs/heads/main'
run: |
docker buildx imagetools create \
--tag ${{ vars.DOCKERHUB_IMAGE }}:latest \
${{ vars.DOCKERHUB_IMAGE }}:${{ github.sha }}
- name: Update repo description
if: github.ref == 'refs/heads/main'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ vars.DOCKERHUB_IMAGE }}