-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.58 KB
/
docker-build-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and Push Docker Image
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
jobs:
build_and_push_image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install 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: Generate Image Tags/Labels
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
flavor: |
latest=true
tags: |
type=semver,priority=200,pattern={{major}}.{{minor}}
type=semver,priority=100,pattern={{version}}
labels: |
org.opencontainers.image.title=deploykf-sync-argocd-apps
org.opencontainers.image.url=https://github.com/${{ github.repository }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.version=ArgoCD ${{ vars.ARGOCD_VERSION}}
- name: Build and Push Image
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
ARGOCD_RELEASE_TAG=${{ vars.ARGOCD_VERSION}}