Skip to content

Build DockerHub images #106

Build DockerHub images

Build DockerHub images #106

Workflow file for this run

name: Build DockerHub images
on:
push:
tags: ["v*"]
workflow_dispatch:
schedule:
- cron: '23 17 12 * *'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- 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: Calculate docker image tag
id: docker_meta
uses: docker/metadata-action@v5
with:
images: packeton/packeton
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=pep440,pattern={{ version }}
type=pep440,pattern={{ major }}.{{ minor }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,scope=${{ github.workflow }},mode=max