Skip to content

chore(deps): update docker/build-push-action action to v6 (#28) #7

chore(deps): update docker/build-push-action action to v6 (#28)

chore(deps): update docker/build-push-action action to v6 (#28) #7

Workflow file for this run

on:
push:
branches: [ main ]
tags: [ 'v*' ]
paths-ignore:
- 'README.md'
- 'gitops/**'
- 'docs/**'
- 'charts/**'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
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 GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
# tag event
type=ref,event=tag
- name: sha short
if: github.ref_type == 'branch'
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push Docker image sha
if: github.ref_type == 'branch'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: true
build-args: |
BUILD_VERSION=${{ steps.sha.outputs.sha_short }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image tag
uses: docker/build-push-action@v6
if: github.ref_type == 'tag'
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: true
build-args: |
BUILD_VERSION=${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}