@@ -3,11 +3,11 @@ name: Image
33on :
44 push :
55 branches :
6- - master
6+ - sync-*
77 pull_request :
88 branches :
9- - master
10- types : [ labeled, unlabeled, opened, synchronize, reopened ]
9+ - sync-*
10+ types : [labeled, unlabeled, opened, synchronize, reopened]
1111
1212concurrency :
1313 group : ${{ github.workflow }}-${{ github.ref }}
@@ -19,17 +19,25 @@ jobs:
1919 set-vars :
2020 permissions :
2121 contents : read
22- if : github.repository == 'argoproj /argo-cd'
22+ if : github.repository == 'codefresh-io /argo-cd'
2323 runs-on : ubuntu-22.04
2424 outputs :
25- image-tag : ${{ steps.image.outputs.tag}}
25+ image-tag : ${{ steps.image-pr .outputs.tag || steps.image-push.outputs.tag }}
2626 platforms : ${{ steps.platforms.outputs.platforms }}
2727 steps :
2828 - uses : actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
2929
30- - name : Set image tag for ghcr
31- run : echo "tag=$(cat ./VERSION)-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
32- id : image
30+ - name : Set image tag (push to feature branch)
31+ if : ${{ github.repository == 'codefresh-io/argo-cd' && github.event_name == 'pull_request' }}
32+ run : |
33+ CLEAN_REF=$(echo "${{ github.head_ref }}" | sed 's|^refs/[^/]*||; s|/|_|g')
34+ echo "tag=v$(cat ./VERSION)-${CLEAN_REF}-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
35+ id : image-pr
36+
37+ - name : Set image tag (push to sync-* branch)
38+ if : ${{ github.repository == 'codefresh-io/argo-cd' && github.event_name == 'push' }}
39+ run : echo "tag=v$(cat ./VERSION)-$(date +%Y-%m-%d)-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
40+ id : image-push
3341
3442 - name : Determine image platforms to use
3543 id : platforms
@@ -46,31 +54,31 @@ jobs:
4654 needs : [set-vars]
4755 permissions :
4856 contents : read
49- packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
57+ packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
5058 id-token : write # for creating OIDC tokens for signing.
51- if : ${{ github.repository == 'argoproj/argo-cd' && github.event_name != 'push' }}
59+ if : ${{ false }}
5260 uses : ./.github/workflows/image-reuse.yaml
5361 with :
5462 # Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
5563 # renovate: datasource=golang-version packageName=golang
56- go-version : 1.23.3
64+ go-version : 1.24.1
5765 platforms : ${{ needs.set-vars.outputs.platforms }}
5866 push : false
5967
6068 build-and-publish :
6169 needs : [set-vars]
6270 permissions :
6371 contents : read
64- packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
72+ packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
6573 id-token : write # for creating OIDC tokens for signing.
66- if : ${{ github.repository == 'argoproj /argo-cd' && github.event_name == 'push ' }}
74+ if : ${{ github.repository == 'codefresh-io /argo-cd' }}
6775 uses : ./.github/workflows/image-reuse.yaml
6876 with :
69- quay_image_name : quay.io/argoproj/ argocd:latest
70- ghcr_image_name : ghcr.io/argoproj /argo-cd/argocd:${{ needs.set-vars.outputs.image-tag }}
77+ quay_image_name : ${{ github.event_name == 'pull_request' && ' quay.io/codefresh/dev/ argocd' || 'quay.io/codefresh/argocd' }}:${{ needs.set-vars.outputs.image-tag }}
78+ # ghcr_image_name: ghcr.io/codefresh-io /argo-cd/argocd:${{ needs.set-vars.outputs.image-tag }}
7179 # Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
7280 # renovate: datasource=golang-version packageName=golang
73- go-version : 1.23.3
81+ go-version : 1.24.1
7482 platforms : ${{ needs.set-vars.outputs.platforms }}
7583 push : true
7684 secrets :
8694 actions : read # for detecting the Github Actions environment.
8795 id-token : write # for creating OIDC tokens for signing.
8896 packages : write # for uploading attestations. (https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#known-issues)
89- if : ${{ github.repository == 'argoproj/argo-cd' && github.event_name == 'push' }}
97+ if : ${{ false }}
9098 # Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
9199 uses : slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
92100 with :
@@ -101,9 +109,9 @@ jobs:
101109 - build-and-publish
102110 - set-vars
103111 permissions :
104- contents : write # for git to push upgrade commit if not already deployed
105- packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
106- if : ${{ github.repository == 'argoproj/argo-cd' && github.event_name == 'push' }}
112+ contents : write # for git to push upgrade commit if not already deployed
113+ packages : write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
114+ if : ${{ false }}
107115 runs-on : ubuntu-22.04
108116 steps :
109117 - uses : actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
@@ -115,5 +123,4 @@ jobs:
115123 git config --global user.email 'ci@argoproj.com'
116124 git config --global user.name 'CI'
117125 git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ needs.set-vars.outputs.image-tag }}' && git push)
118- working-directory: argoproj-deployments/argocd
119-
126+ working-directory: argoproj-deployments/argocd
0 commit comments