chore(deps): update docker/build-push-action action to v6.12.0 (#278) #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build agent | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build-agent: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
agent: | |
- docker-agent | |
- kubernetes-agent | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Generate commit hash | |
id: generate | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Login to GitHub Container Registry | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Docker Metadata | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ghcr.io/glasskube/cloud/${{ matrix.agent }} | |
tags: | | |
type=ref,event=branch | |
type=sha,event=branch | |
type=semver,pattern={{version}} | |
labels: | | |
org.opencontainers.image.description=Agent software for the Glasskube Cloud Software Distribution Platform | |
org.opencontainers.image.vendor=Glasskube | |
- name: Docker build (push only for tag) | |
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0 | |
with: | |
file: Dockerfile.${{ matrix.agent }} | |
build-args: | | |
COMMIT=${{ steps.generate.outputs.sha_short }} | |
VERSION=${{ github.ref_name }} | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |