Skip to content

chore: Change lock defaults #10

chore: Change lock defaults

chore: Change lock defaults #10

Workflow file for this run

name: Create Release and Push to Container Registries
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: The tag to publish
required: true
jobs:
publish-image:
name: Build and Push to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name == 'push'
- uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
ref: refs/tags/${{ github.event.inputs.tag }}
- run: |
echo REPOSITORY="$(
echo "${GITHUB_REPOSITORY}" |
tr '[:upper:]' '[:lower:]' |
sed 's/docker-//'
)" >"${GITHUB_ENV}"
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5.5.1
with:
images: |
${{ env.REPOSITORY }}
ghcr.io/${{ env.REPOSITORY }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- uses: docker/setup-qemu-action@v3.2.0
- uses: docker/setup-buildx-action@v3.7.1
- id: docker_build
uses: docker/build-push-action@v6.9.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: |
linux/amd64
linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: ghalactic/github-release-from-tag@v5
with:
summaryEnabled: false
- uses: peter-evans/dockerhub-description@v4.0.0
with:
repository: kineticcafe/${{ env.REPOSITORY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}