mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-04 07:22:15 +02:00
chore(ci): use docker/metadata-action (#756)
* chore(ci): use `docker/metadata-action` - Replace custom `setup-image-vars` action by `docker/metadata-action` - Automatically add latest tag on semver tag Signed-off-by: Ronny Moreas <ronny.moreas@kuleuven.be> * chore(ci): add image tag on PR Signed-off-by: Ronny Moreas <ronny.moreas@kuleuven.be> * chore(ci): cleanup trailing spaces Signed-off-by: Ronny Moreas <ronny.moreas@kuleuven.be> * chore(ci): remove `setup-image-vars` action Signed-off-by: Ronny Moreas <ronny.moreas@kuleuven.be> --------- Signed-off-by: Ronny Moreas <ronny.moreas@kuleuven.be>
This commit is contained in:
@@ -30,10 +30,13 @@ jobs:
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
dockerfile:
|
||||
- Dockerfile
|
||||
- Dockerfile.debian-stable-slim
|
||||
- Dockerfile.ubuntu
|
||||
image:
|
||||
- dockerfile: Dockerfile
|
||||
suffix: ""
|
||||
- dockerfile: Dockerfile.debian-stable-slim
|
||||
suffix: "-debian-stable-slim"
|
||||
- dockerfile: Dockerfile.ubuntu
|
||||
suffix: "-ubuntu"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -48,11 +51,16 @@ jobs:
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Set up Image Variables
|
||||
id: vars
|
||||
uses: ./.github/actions/setup-image-vars
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
images: ghcr.io/${{ github.repository }}${{ matrix.image.suffix }}
|
||||
flavor: latest=true
|
||||
tags: |
|
||||
type=raw,value=canary,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{raw}}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
@@ -65,10 +73,10 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
file: ${{ matrix.image.dockerfile }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}${{ steps.vars.outputs.suffix }}:${{ steps.vars.outputs.tag }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Reference in New Issue
Block a user