Skip to content

Commit 3204171

Browse files
committed
switch to golang 1.23, update workflows and add azcli container image
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent 9711d1f commit 3204171

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
groups:
8+
all-github-actions:
9+
patterns: [ "*" ]
710

811
- package-ecosystem: "docker"
912
directory: "/"
1013
schedule:
1114
interval: "weekly"
15+
groups:
16+
all-docker-versions:
17+
patterns: [ "*" ]
1218

1319
- package-ecosystem: "gomod"
1420
directory: "/"
1521
schedule:
1622
interval: "weekly"
23+
groups:
24+
all-go-mod-patch-and-minor:
25+
patterns: [ "*" ]
26+
update-types: [ "patch", "minor" ]

.github/workflows/build-docker.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
check-latest: true
2626

2727
- name: Run Golangci lint
28-
uses: golangci/golangci-lint-action@v4
28+
uses: golangci/golangci-lint-action@v6
2929
with:
3030
version: latest
3131
args: --print-resources-usage
@@ -42,6 +42,11 @@ jobs:
4242
suffix: ""
4343
latest: "auto"
4444

45+
- Dockerfile: Dockerfile
46+
target: "final-azcli"
47+
suffix: "-azcli"
48+
latest: false
49+
4550
runs-on: ubuntu-latest
4651
steps:
4752
- uses: actions/checkout@v4
@@ -61,7 +66,9 @@ jobs:
6166
id: docker_meta
6267
uses: docker/metadata-action@v5
6368
with:
64-
images: ${{ github.repository }},quay.io/${{ github.repository }}
69+
images: |
70+
${{ github.repository }}
71+
quay.io/${{ github.repository }}
6572
labels: |
6673
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
6774
flavor: |
@@ -90,7 +97,7 @@ jobs:
9097
password: ${{ secrets.QUAY_TOKEN }}
9198

9299
- name: ${{ inputs.publish && 'Build and push' || 'Build' }}
93-
uses: docker/build-push-action@v5
100+
uses: docker/build-push-action@v6
94101
with:
95102
context: .
96103
file: ./${{ matrix.Dockerfile }}

Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#############################################
22
# Build
33
#############################################
4-
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as build
4+
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build
55

66
RUN apk upgrade --no-cache --force
77
RUN apk add --update build-base make git
@@ -21,16 +21,26 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
2121
#############################################
2222
# Test
2323
#############################################
24-
FROM gcr.io/distroless/static as test
24+
FROM gcr.io/distroless/static AS test
2525
USER 0:0
2626
WORKDIR /app
2727
COPY --from=build /go/src/github.com/webdevops/azure-janitor/azure-janitor .
2828
RUN ["./azure-janitor", "--help"]
2929

30+
#############################################
31+
# final-azcli
32+
#############################################
33+
FROM mcr.microsoft.com/azure-cli AS final-azcli
34+
ENV LOG_JSON=1
35+
WORKDIR /
36+
COPY --from=test /app .
37+
USER 1000:1000
38+
ENTRYPOINT ["/azure-auditor"]
39+
3040
#############################################
3141
# static-final
3242
#############################################
33-
FROM gcr.io/distroless/static as final-static
43+
FROM gcr.io/distroless/static AS final-static
3444
ENV LOG_JSON=1
3545
WORKDIR /
3646
COPY --from=test /app .

0 commit comments

Comments
 (0)