Skip to content

Commit 7738540

Browse files
authored
Merge pull request #167 from spiffe/fix-workflow5
Fix workflow after merge
2 parents 86dbfb5 + e811927 commit 7738540

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

.github/workflows/build.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
uses: sigstore/[email protected]
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 }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
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
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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

7375
echo "Done!"

0 commit comments

Comments
 (0)