77
88env :
99 DOCKER_FILE_PATH : Dockerfile
10- KUBERNETES_VERSION : " 1.18.0"
11- KIND_VERSION : " 0.10.0"
10+ DOCKER_UBI_FILE_PATH : Dockerfile.ubi
11+ KUBERNETES_VERSION : " 1.19.0"
12+ KIND_VERSION : " 0.17.0"
1213 REGISTRY : ghcr.io
1314
1415jobs :
16+ qa :
17+ uses : stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.54
18+ with :
19+ MD_CONFIG : .github/md_config.json
20+ DOC_SRC : README.md docs
21+ MD_LINT_CONFIG : .markdownlint.yaml
1522 build :
1623 runs-on : ubuntu-latest
1724 name : Build
1825 if : " ! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
1926 steps :
2027 - name : Check out code
21- uses : actions/checkout@v3
28+ uses : actions/checkout@v4
2229 with :
2330 ref : ${{github.event.pull_request.head.sha}}
2431
2532 # Setting up helm binary
2633 - name : Set up Helm
2734 uses : azure/setup-helm@v3
2835
36+ - name : Helm chart unit tests
37+ uses : d3adb5/helm-unittest-action@v2
38+ with :
39+ charts : deployments/kubernetes/chart/reloader
40+
2941 - name : Set up Go
30- uses : actions/setup-go@v4
42+ uses : actions/setup-go@v5
3143 with :
3244 go-version-file : ' go.mod'
3345 check-latest : true
4052 - name : Run golangci-lint
4153 uses : golangci/golangci-lint-action@v3
4254 with :
43- version : v1.51.1
55+ version : latest
4456 only-new-issues : false
4557 args : --timeout 10m
4658
4961 cd deployments/kubernetes/chart/reloader
5062 helm lint
5163
52- - name : Link check
53- uses : gaurav-nelson/github-action-markdown-link-check@v1
54-
5564 - name : Install kubectl
5665 run : |
5766 curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
@@ -74,21 +83,23 @@ jobs:
7483 - name : Test
7584 run : make test
7685
77- - name : Generate Tag
86+ - name : Generate Tags
7887 id : generate_tag
7988 run : |
8089 sha=${{ github.event.pull_request.head.sha }}
8190 tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
82- echo "##[set-output name=GIT_TAG;]$(echo ${tag})"
91+ ubi_tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-UBI-${sha:0:8}"
92+ echo "GIT_TAG=$(echo ${tag})" >> $GITHUB_OUTPUT
93+ echo "GIT_UBI_TAG=$(echo ${ubi_tag})" >> $GITHUB_OUTPUT
8394
8495 - name : Set up QEMU
85- uses : docker/setup-qemu-action@v2
96+ uses : docker/setup-qemu-action@v3
8697
8798 - name : Set up Docker Buildx
88- uses : docker/setup-buildx-action@v2
99+ uses : docker/setup-buildx-action@v3
89100
90101 - name : Login to Docker Registry
91- uses : docker/login-action@v2
102+ uses : docker/login-action@v3
92103 with :
93104 username : ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
94105 password : ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
98109 echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
99110
100111 - name : Build and Push Docker Image to Docker registry
101- uses : docker/build-push-action@v4
112+ uses : docker/build-push-action@v5
102113 with :
103114 context : .
104115 file : ${{ env.DOCKER_FILE_PATH }}
@@ -114,8 +125,27 @@ jobs:
114125 org.opencontainers.image.created=${{ steps.prep.outputs.created }}
115126 org.opencontainers.image.revision=${{ github.sha }}
116127
128+ - name : Build and Push Docker UBI Image to Docker registry
129+ uses : docker/build-push-action@v5
130+ with :
131+ context : .
132+ file : ${{ env.DOCKER_UBI_FILE_PATH }}
133+ pull : true
134+ push : true
135+ build-args : |
136+ BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
137+ BUILDER_IMAGE=${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
138+ cache-to : type=inline
139+ platforms : linux/amd64,linux/arm64
140+ tags : |
141+ ${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
142+ labels : |
143+ org.opencontainers.image.source=${{ github.event.repository.clone_url }}
144+ org.opencontainers.image.created=${{ steps.prep.outputs.created }}
145+ org.opencontainers.image.revision=${{ github.sha }}
146+
117147 - name : Login to ghcr registry
118- uses : docker/login-action@v2
148+ uses : docker/login-action@v3
119149 with :
120150 registry : ${{env.REGISTRY}}
121151 username : ${{github.actor}}
@@ -126,7 +156,7 @@ jobs:
126156 echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
127157
128158 - name : Build and Push Docker Image to ghcr registry
129- uses : docker/build-push-action@v4
159+ uses : docker/build-push-action@v5
130160 with :
131161 context : .
132162 file : ${{ env.DOCKER_FILE_PATH }}
@@ -142,13 +172,32 @@ jobs:
142172 org.opencontainers.image.created=${{ steps.prep.outputs.created }}
143173 org.opencontainers.image.revision=${{ github.sha }}
144174
175+ - name : Build and Push Docker UBI Image to ghcr registry
176+ uses : docker/build-push-action@v5
177+ with :
178+ context : .
179+ file : ${{ env.DOCKER_UBI_FILE_PATH }}
180+ pull : true
181+ push : true
182+ build-args : |
183+ BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
184+ BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
185+ cache-to : type=inline
186+ platforms : linux/amd64,linux/arm64
187+ tags : |
188+ ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
189+ labels : |
190+ org.opencontainers.image.source=${{ github.event.repository.clone_url }}
191+ org.opencontainers.image.created=${{ steps.prep.outputs.created }}
192+ org.opencontainers.image.revision=${{ github.sha }}
193+
145194 - name : Comment on PR
146195 uses : mshick/add-pr-comment@v2
147196 if : always()
148197 env :
149198 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
150199 with :
151- message-success : ' @${{ github.actor }} Image is available for testing. `docker pull ghcr.io/ ${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`'
200+ message-success : ' @${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
152201 message-failure : ' @${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
153202 allow-repeats : true
154203
0 commit comments