Skip to content

Commit 8a5e467

Browse files
committed
ci: Update buildx
1 parent feb6b30 commit 8a5e467

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,42 @@ jobs:
2121
cd config/release
2222
kustomize edit set image fluxcd/notification-controller=fluxcd/notification-controller:${{ steps.get_version.outputs.VERSION }}
2323
kustomize build . > notification-controller.yaml
24-
- uses: crazy-max/ghaction-docker-buildx@v1
25-
- name: Publish image
26-
run: |
27-
echo "${{ secrets.DOCKER_FLUXCD_PASSWORD }}" | docker login --username fluxcdbot --password-stdin
28-
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io --username fluxcdbot --password-stdin
29-
30-
docker buildx build --platform "linux/amd64" \
31-
--output "type=image,push=true" \
32-
--build-arg "REVISION=${GITHUB_SHA}" \
33-
--build-arg "VERSION=${{ steps.get_version.outputs.VERSION }}" \
34-
--build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
35-
--tag "ghcr.io/fluxcd/notification-controller:${{ steps.get_version.outputs.VERSION }}" \
36-
--tag "docker.io/fluxcd/notification-controller:${{ steps.get_version.outputs.VERSION }}" \
37-
--file Dockerfile .
38-
39-
docker buildx build --platform "linux/arm64" \
40-
--output "type=image,push=true" \
41-
--build-arg "REVISION=${GITHUB_SHA}" \
42-
--build-arg "VERSION=${{ steps.get_version.outputs.VERSION }}" \
43-
--build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
44-
--tag "ghcr.io/fluxcd/notification-controller-arm64:${{ steps.get_version.outputs.VERSION }}" \
45-
--file Dockerfile .
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@master
26+
with:
27+
platforms: all
28+
- name: Set up Docker Buildx
29+
id: buildx
30+
uses: docker/setup-buildx-action@master
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v1
33+
with:
34+
registry: ghcr.io
35+
username: fluxcdbot
36+
password: ${{ secrets.GHCR_TOKEN }}
37+
- name: Login to Docker Hub
38+
uses: docker/login-action@v1
39+
with:
40+
username: fluxcdbot
41+
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
42+
- name: Publish amd64 image
43+
uses: docker/build-push-action@v2-build-push
44+
with:
45+
push: ${{ github.event_name != 'pull_request' }}
46+
builder: ${{ steps.buildx.outputs.name }}
47+
context: .
48+
file: ./Dockerfile
49+
platforms: linux/amd64
50+
tags: ghcr.io/fluxcd/notification-controller:${{ steps.get_version.outputs.VERSION }},docker.io/fluxcd/notification-controller:${{ steps.get_version.outputs.VERSION }}
51+
- name: Publish arm64 image
52+
uses: docker/build-push-action@v2-build-push
53+
with:
54+
push: ${{ github.event_name != 'pull_request' }}
55+
builder: ${{ steps.buildx.outputs.name }}
56+
context: .
57+
file: ./Dockerfile
58+
platforms: linux/arm64
59+
tags: ghcr.io/fluxcd/notification-controller-arm64:${{ steps.get_version.outputs.VERSION }}
4660
- name: Create release
4761
id: create_release
4862
uses: actions/create-release@latest

Dockerfile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@ RUN CGO_ENABLED=0 go build -a -o notification-controller main.go
2020

2121
FROM alpine:3.12
2222

23-
ARG BUILD_DATE
24-
ARG VERSION
25-
ARG REVISION
26-
27-
LABEL org.opencontainers.image.created=$BUILD_DATE \
28-
org.opencontainers.image.version=$VERSION \
29-
org.opencontainers.image.revision=$REVISION \
30-
org.opencontainers.image.licenses="Apache-2.0" \
31-
org.opencontainers.image.source="https://github.com/fluxcd/notification-controller" \
32-
org.opencontainers.image.documentation="https://toolkit.fluxcd.io" \
33-
org.opencontainers.image.authors="Flux CD"
34-
3523
RUN apk add --no-cache ca-certificates tini
3624

3725
COPY --from=builder /workspace/notification-controller /usr/local/bin/

0 commit comments

Comments
 (0)