improve metadata
All checks were successful
Build and Push container / build_concierge_backend (push) Successful in 33s
All checks were successful
Build and Push container / build_concierge_backend (push) Successful in 33s
This commit is contained in:
parent
63c93b9a1f
commit
5fcb139c25
1 changed files with 39 additions and 13 deletions
52
.github/workflows/build.yaml
vendored
52
.github/workflows/build.yaml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue