@@ -86,14 +86,63 @@ jobs:
8686 submodules : recursive
8787 persist-credentials : false
8888
89- - name : ' Build and sign ${{ matrix.component }} image '
90- uses : edera-dev/actions/build-and-sign-image@v0.0.6
89+ - name : ' Setup docker buildx '
90+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
9191 with :
92- component : ' ${{ matrix.component }}'
93- event : ' ${{ github.event_name }}'
94- repositories : |
95- ghcr.io/edera-dev/${{ matrix.component }}
96- ${{ secret.GCP_REGION }}-docker.pkg.dev/${{ secret.GCP_PROJECT }}/staging/${{ matrix.component }}
97- gcp_region : ' ${{ secret.GCP_REGION }}'
98- gcp_workload_identity_provider : ' ${{ secret.GCP_WORKLOAD_IDENTITY_PROVIDER }}'
99- gcp_service_account : ' ${{ secret.GCP_SERVICE_ACCOUNT }}'
92+ cache-binary : false
93+
94+ - name : ' Login to ghcr'
95+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
96+ with :
97+ registry : ghcr.io
98+ username : ' ${{ github.actor }}'
99+ password : ' ${{ github.token }}'
100+
101+ - name : Docker meta
102+ uses : docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
103+ id : meta
104+ with :
105+ images : |
106+ ghcr.io/edera-dev/protect-${{ matrix.component }}
107+ tags : |
108+ # Tag with branch on push
109+ type=ref,event=branch
110+
111+ # Tag with short sha on all events
112+ type=sha,prefix=
113+
114+ # Tag version and stable on tag push
115+ type=semver,pattern={{raw}}
116+ type=semver,pattern={{version}}
117+ type=semver,pattern={{major}}
118+ type=semver,pattern={{major}}.{{minor}}
119+ type=semver,pattern=stable
120+
121+ # Tag nightly on schedule event
122+ type=schedule,pattern=nightly
123+
124+ - name : ' Docker build and push protect-${{ matrix.component }}'
125+ uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
126+ id : push
127+ with :
128+ file : Dockerfile
129+ platforms : linux/amd64
130+ tags : ' ${{ steps.meta.outputs.tags }}'
131+ push : true
132+
133+ - name : ' Install cosign'
134+ uses : sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
135+
136+ - name : ' Cosign sign all images'
137+ shell : bash
138+ run : |
139+ images=""
140+ for tag in ${TAGS}; do
141+ pullstring="${tag}@${DIGEST}"
142+ echo "Signing ${pullstring}"
143+
144+ cosign sign --yes "${pullstring}"
145+ done
146+ env :
147+ TAGS : ' ${{ steps.meta.outputs.tags }}'
148+ DIGEST : ' ${{ steps.push.outputs.digest }}'
0 commit comments