Skip to content

Commit 1118dea

Browse files
authored
Add additional tags for argocd live preview
1 parent d5e6c7d commit 1118dea

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/build-push-ghcr.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ on:
1717
branch:
1818
type: string
1919
default: 'main'
20+
pr-head-sha:
21+
required: false
22+
type: string
23+
pr-head-ref:
24+
required: false
25+
type: string
2026

2127
env:
2228
REGISTRY: ghcr.io/clubcedille
@@ -25,8 +31,11 @@ jobs:
2531
build-and-push:
2632
runs-on: ubuntu-latest
2733
steps:
28-
- name: Check Out Repo
29-
uses: actions/checkout@v4
34+
- name: Check out source
35+
uses: actions/checkout@v5
36+
with:
37+
ref: ${{ inputs.pr-head-ref || inputs.pr-head-sha || '' }}
38+
fetch-depth: 0
3039

3140
- name: Set up Docker Buildx
3241
uses: docker/setup-buildx-action@v3
@@ -43,14 +52,16 @@ jobs:
4352
uses: docker/metadata-action@v5
4453
with:
4554
images: ${{ env.REGISTRY }}/${{ inputs.container-name }}
55+
context: git
4656
tags: |
4757
type=ref,event=branch
4858
type=sha
49-
type=sha,format=long
59+
type=sha,format=long,prefix=
5060
type=ref,event=pr
61+
type=raw,value=${{ inputs.pr-head-sha }},enable=${{ inputs.pr-head-sha != '' }}
5162
type=raw,value=${{ inputs.branch }},enable=${{ github.event_name == 'workflow_dispatch' }}
5263
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
53-
64+
5465
- name: Build and push Docker image
5566
uses: docker/build-push-action@v6
5667
with:

0 commit comments

Comments
 (0)