Skip to content

Commit 09acbf2

Browse files
mumoshuSajfer
authored andcommitted
Publish canary container images via ghcr.io
Ref roboll/helmfile#1824
1 parent 6e61dd3 commit 09acbf2

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Docker"
2+
3+
outputs:
4+
sha_short:
5+
description: "The short SHA used for image builds"
6+
value: ${{ steps.vars.outputs.sha_short }}
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Get Short SHA
12+
id: vars
13+
run: |
14+
echo ::set-output name=sha_short::${GITHUB_SHA::7}
15+
shell: bash
16+
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
with:
23+
version: latest
24+
25+
# - name: Login to DockerHub
26+
# if: ${{ github.ref == 'main' && github.event.pull_request.merged == true }}
27+
# uses: docker/login-action@v1
28+
# with:
29+
# username: ${{ inputs.username }}
30+
# password: ${{ inputs.password }}

.github/workflows/canary_images.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish Canary Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- .github/workflows/ci.yml
9+
- .github/workflows/lock.yml
10+
- "docs/**"
11+
- "hack/**"
12+
- "**.md"
13+
- ".gitignore"
14+
- "Makefile"
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
name: Build and Publish Canary Images
23+
env:
24+
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Setup Docker Environment
30+
id: vars
31+
uses: ./.github/actions/setup-docker-environment
32+
33+
- name: Login to GitHub Container Registry
34+
uses: docker/login-action@v1
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Build and Push
41+
uses: docker/build-push-action@v2
42+
with:
43+
file: Dockerfile
44+
platforms: linux/amd64,linux/arm64
45+
push: true
46+
tags: |
47+
ghcr.io/${{ github.repository }}:canary
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
50+
51+
- name: Build and Push (debian stable-slim)
52+
uses: docker/build-push-action@v2
53+
with:
54+
file: Dockerfile.debian
55+
platforms: linux/amd64,linux/arm64
56+
push: true
57+
tags: |
58+
ghcr.io/${{ github.repository }}-debian-stable-slim:canary
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ RUN make static-linux
99

1010
FROM alpine:3.13
1111

12+
LABEL org.opencontainers.image.source https://github.com/helmfile/helmfile
13+
1214
RUN apk add --no-cache ca-certificates git bash curl jq
1315

1416
ARG HELM_VERSION="v3.7.2"

Dockerfile.debian

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN make static-linux
1515

1616
FROM debian:stable-slim
1717

18+
LABEL org.opencontainers.image.source https://github.com/helmfile/helmfile
19+
1820
RUN apt-get update \
1921
&& apt-get install -y --no-install-recommends \
2022
ca-certificates \

0 commit comments

Comments
 (0)