Skip to content

Commit

Permalink
work on building containers in PR-Branches (#160)
Browse files Browse the repository at this point in the history
* work on building containers in PR-Branches

* more cleanup

* not sure now
  • Loading branch information
dmolik authored Jan 10, 2025
1 parent ecdb459 commit 5937599
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
50 changes: 39 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
name: Go Build
name: Build

on:
pull_request:

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Build it
run: make V=1
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Build it
run: make V=1
build-operator-container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Build it
run: make V=1
- name: Extract metadata (Operator tags, labels) for Docker
id: meta_operator
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/hyperspike/valkey-operator:${{ github.sha }}
- name: Build Operator image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_operator
with:
file: Dockerfile.controller
context: .
push: false
visibility: public
tags: ${{ steps.meta_operator.outputs.images }}
labels: ${{ steps.meta_operator.outputs.labels }}
7 changes: 4 additions & 3 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VALKEY_VERSION: 8.0.1
VALKEY_VERSION: 8.0.2
RELEASE_VERSION: ${{ github.ref_name }}

jobs:
build-and-push-image:
Expand All @@ -40,7 +41,7 @@ jobs:
id: meta_controller
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ env.RELEASE_VERSION }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
- name: Extract metadata (Sidecar tags, labels) for Docker
id: meta_sidecar
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
context: .
push: true
visibility: public
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ env.RELEASE_VERSION }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
labels: ${{ steps.meta_manager.outputs.labels }}
- name: Build and push Sidecar image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
Expand Down

0 comments on commit 5937599

Please sign in to comment.