File tree Expand file tree Collapse file tree 3 files changed +50
-6
lines changed
Expand file tree Collapse file tree 3 files changed +50
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Build Containers
2+
3+ on :
4+ pull_request : {}
5+
6+ env :
7+ REGISTRY : ghcr.io
8+ REPOSITORY : spiffe
9+ COSIGN_EXPERIMENTAL : 1
10+
11+ jobs :
12+ build :
13+ runs-on : ${{ matrix.archmap[matrix.arch] }}
14+ strategy :
15+ matrix :
16+ app : [pilot, keeper, nexus]
17+ arch : [linux/amd64, linux/arm64]
18+ archmap : [{ "linux/amd64": "ubuntu-24.04", "linux/arm64": "ubuntu-24.04-arm" }]
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
25+
26+ - name : Set up QEMU
27+ uses : docker/setup-qemu-action@v3
28+
29+ - name : Set up Docker Buildx
30+ uses : docker/setup-buildx-action@v3
31+
32+ - name : Install cosign
33+ 34+
35+ # Build and push images using the script
36+ - name : Build and push images
37+ run : |
38+ # Extract version from release tag
39+ VERSION="${{ github.sha }}"
40+
41+ ./k8s/build-push-sign.sh ${{ matrix.app }} ${{ matrix.arch }} ${VERSION} ${{ env.REGISTRY }} ${{ env.REPOSITORY }}
Original file line number Diff line number Diff line change 5252 # Extract version from release tag
5353 VERSION="${{ github.event.release.tag_name }}"
5454 VERSION=${VERSION#v} # Remove 'v' prefix if present
55+ export PUSH=true
5556
5657 ./k8s/build-push-sign.sh ${{ matrix.app }} ${{ matrix.arch }} ${VERSION} ${{ env.REGISTRY }} ${{ env.REPOSITORY }}
5758
Original file line number Diff line number Diff line change @@ -61,13 +61,15 @@ docker buildx build \
6161 --label " org.opencontainers.image.licenses=Apache-2.0" \
6262 --label " org.opencontainers.image.title=spike" \
6363 --label " org.opencontainers.image.description=SPIKE is a lightweight secrets store that uses SPIFFE as its identity control plane" \
64- " $TAG_ARGS " \
64+ $TAG_ARGS \
6565 .
6666
67- # Push images
68- echo " Pushing images"
69- for tag in " ${TAGS[@]} " ; do
70- docker push " $tag "
71- done
67+ if [ " x$PUSH " != " x" ]; then
68+ # Push images
69+ echo " Pushing images"
70+ for tag in " ${TAGS[@]} " ; do
71+ docker push " $tag "
72+ done
73+ fi
7274
7375echo " Done!"
You can’t perform that action at this time.
0 commit comments