Skip to content

Bump version: 0.16.0 → 0.16.1 #36

Bump version: 0.16.0 → 0.16.1

Bump version: 0.16.0 → 0.16.1 #36

name: Publish Docker Images
on:
push:
branches:
- main
tags:
- v*
jobs:
build-and-publish:
name: Build and publish Docker images to Docker Hub
runs-on: ubuntu-latest
steps:
- 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 DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish to registry
# every PR will trigger a push event on main, so check the push event is actually coming from main
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'yadage/packtivity'
id: docker_build_latest
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: |
${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
push: true
platforms: linux/amd64,linux/arm64
- name: Build and publish to registry with release tag
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'yadage/packtivity'
id: docker_build_release
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: |
${{ github.repository }}:latest
${{ github.repository }}:latest-stable
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:latest-stable
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
push: true
platforms: linux/amd64,linux/arm64