Skip to content

Commit 3ecb88c

Browse files
committed
ci: add GitHub Actions workflow to build patched controller image
1 parent e177815 commit 3ecb88c

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build patched controller image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-pf9*'
7+
8+
jobs:
9+
build:
10+
name: Build and push controller image
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Log in to GHCR
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract tag name
31+
id: tag
32+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
33+
34+
- name: Build and push
35+
id: build
36+
uses: docker/build-push-action@v6
37+
with:
38+
context: .
39+
file: Dockerfile.controller
40+
platforms: linux/amd64
41+
push: true
42+
tags: ghcr.io/platform9/cert-manager-controller:${{ steps.tag.outputs.tag }}
43+
cache-from: type=gha
44+
cache-to: type=gha,mode=max
45+
46+
- name: Output image digest
47+
run: |
48+
echo "## Controller Image Built" >> $GITHUB_STEP_SUMMARY
49+
echo "" >> $GITHUB_STEP_SUMMARY
50+
echo "**Tag:** \`${{ steps.tag.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
51+
echo "**Digest:** \`${{ steps.build.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
52+
echo "" >> $GITHUB_STEP_SUMMARY
53+
echo "Update pf9-flux-src kustomization.yaml with:" >> $GITHUB_STEP_SUMMARY
54+
echo "\`\`\`yaml" >> $GITHUB_STEP_SUMMARY
55+
echo "- name: quay.io/jetstack/cert-manager-controller" >> $GITHUB_STEP_SUMMARY
56+
echo " newName: ghcr.io/platform9/cert-manager-controller" >> $GITHUB_STEP_SUMMARY
57+
echo " newTag: ${{ steps.tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
58+
echo " digest: ${{ steps.build.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
59+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)