Skip to content

Commit 27c6f9c

Browse files
authored
fix: build and push to docker registry on tag creation (#121)
Signed-off-by: Skye Gill <[email protected]> Signed-off-by: Skye Gill <[email protected]>
1 parent b1ed770 commit 27c6f9c

File tree

2 files changed

+48
-54
lines changed

2 files changed

+48
-54
lines changed

.github/workflows/build-oci.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
branches:
66
- main
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
712
jobs:
813
release-please:
914
runs-on: ubuntu-latest
@@ -48,3 +53,46 @@ jobs:
4853
config/webhook/certificate.yaml
4954
config/rendered/release.yaml
5055
config/samples/end-to-end.yaml
56+
57+
build-oci:
58+
needs: release-please
59+
runs-on: ubuntu-latest
60+
if: ${{ needs.release-please.outputs.release_created }}
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v3
64+
with:
65+
submodules: recursive
66+
67+
- name: Log in to the Container registry
68+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
69+
with:
70+
registry: ${{ env.REGISTRY }}
71+
username: ${{ github.actor }}
72+
password: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- name: Extract metadata (tags, labels) for Docker
75+
id: meta
76+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
77+
with:
78+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
79+
80+
- name: Set up QEMU
81+
uses: docker/setup-qemu-action@master
82+
with:
83+
platforms: all
84+
85+
- name: Set up Docker Buildx
86+
id: buildx
87+
uses: docker/setup-buildx-action@master
88+
89+
- name: Build
90+
uses: docker/build-push-action@v2
91+
with:
92+
builder: ${{ steps.buildx.outputs.name }}
93+
context: .
94+
file: ./Dockerfile
95+
platforms: linux/amd64,linux/arm64
96+
push: true
97+
tags: ${{ steps.meta.outputs.tags }}
98+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)