-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for building and pushing OCI configuration
Signed-off-by: Dennis Marttinen <[email protected]>
- Loading branch information
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
on: | ||
# TODO: Change to main merges | ||
pull_request: | ||
|
||
name: OCI | ||
jobs: | ||
push: | ||
name: Push | ||
runs-on: ubuntu-latest | ||
container: | ||
image: fluxcd/flux-cli:v2.0.1 | ||
options: --user root | ||
steps: | ||
- name: Install dependencies | ||
run: apk --no-cache add docker git make | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check out sources | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
- name: Mark sources as safe for Git | ||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
- name: Build and push OCI artifacts | ||
run: make push-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
all: build-metrics | ||
|
||
build-metrics: | ||
build-all: build-metrics | ||
push-all: push-metrics | ||
|
||
build-%: | ||
test -d "$*" | ||
mkdir -p out | ||
kustomize build --enable-helm "$*" > "out/$*.yaml" | ||
|
||
push-%: | ||
# Push manifests to GHCR using the short Git SHA as the OCI artifact tag | ||
flux push artifact "oci://ghcr.io/testk8s-platform/$*:$(shell git rev-parse --short HEAD)" \ | ||
--path="$*" \ | ||
--source="$(shell git config --get remote.origin.url)" \ | ||
--revision="$(shell git branch --show-current)@sha1:$(shell git rev-parse HEAD)" | ||
|
||
update-observability: | ||
curl -sSL https://raw.githubusercontent.com/cilium/cilium/main/examples/kubernetes/addons/prometheus/monitoring-example.yaml > base/cilium-observability/manifest.gen.yaml | ||
|
||
.PHONY: build-all push-all $(filter build-%,$(MAKECMDGOALS)) $(filter push-%,$(MAKECMDGOALS)) update-observability |