improve metadata
All checks were successful
Build and Push container / build_concierge_backend (push) Successful in 33s

This commit is contained in:
Angel Nunez Mencias 2024-11-09 19:11:08 -03:00
parent 63c93b9a1f
commit 5fcb139c25
Signed by: angel.nunez
SSH key fingerprint: SHA256:z1nFAg1v1AfbhEHrgBetByUJUwziv2R2f4VyN75opcg

View file

@ -2,12 +2,20 @@ name: Build and Push container
run-name: Build and Push container
on:
workflow_dispatch:
create:
#schedule:
# - cron: "0 10 * * *"
push:
branches:
- 'main'
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'main'
- 'master'
env:
VCS_REF: ${{ github.sha }}
VERSION: 0.0.1
IMAGE: git.kvant.cloud/phoenix/docker_tpl
IMAGE: git.kvant.cloud/${{github.repository}}
jobs:
build_concierge_backend:
runs-on: ubuntu-latest
@ -30,19 +38,37 @@ jobs:
registry: git.kvant.cloud
username: ${{ vars.PHOENIX_PACKAGE_WRITER_USERNAME }}
password: ${{ secrets.PHOENIX_PACKAGE_WRITER_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{env.IMAGE}}
# 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
- name: Build and push to gitea registry
uses: docker/build-push-action@v6
with:
push: true
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
provenance: mode=max
sbom: true
build-args: |
BUILD_DATE=${{ steps.current_time.outputs.time }}
image: ${{ env.IMAGE }}
BUILD_DATE=${{ steps.current_time.outputs.time }}
cache-from: |
type=registry,ref=${{ env.IMAGE }}:buildcache
type=registry,ref=${{ env.IMAGE }}:${{ github.ref_name }}
type=registry,ref=${{ env.IMAGE }}:latest
cache-to: type=inline
tags: |
${{ env.IMAGE }}:${{ github.ref_name }}
${{ env.IMAGE }}:latest
type=registry,ref=${{ env.IMAGE }}:main
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max,image-manifest=true