Skip to content

Commit

Permalink
fix: build and push to docker registry on tag creation (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: Skye Gill <gill.skye95@gmail.com>

Signed-off-by: Skye Gill <gill.skye95@gmail.com>
  • Loading branch information
skyerus committed Oct 18, 2022
1 parent b1ed770 commit 27c6f9c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/build-oci.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release-please:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,3 +53,46 @@ jobs:
config/webhook/certificate.yaml
config/rendered/release.yaml
config/samples/end-to-end.yaml
build-oci:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 27c6f9c

Please sign in to comment.