Skip to content

Commit

Permalink
feat: add dev build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JTaeuber committed Oct 21, 2024
1 parent cf92f77 commit 2dc1666
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/create_dev_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create dev build

on:
workflow_dispatch:

jobs:
create_dev_build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract Chart Version
id: chart_version
run: |
version=$(yq e '.version' ./test-chart/Chart.yaml)
echo "version=$version" >> $GITHUB_ENV
- name: Dispatch event to create dev build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: caas-team/GoKubeDownscaler
event-type: create-dev-build
client-payload: '{"version": "${{ env.version }}-dev"}'
17 changes: 15 additions & 2 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push Image

on:
repository_dispatch:
types: [release-new-version]
types: [release-new-version, create-dev-build]

jobs:
build:
Expand All @@ -13,6 +13,7 @@ jobs:

- name: Docker meta
id: meta
if: github.event.action == 'release-new-version'
uses: docker/metadata-action@v5
with:
images: |
Expand All @@ -22,6 +23,16 @@ jobs:
latest
${{ github.event.client_payload.appVersion }}
- name: Dev docker meta
id: dev-meta
if: github.event.action == 'create-dev-build'
uses: docker/metadata-action@v5
with:
images: |
mtr.devops.telekom.de/caas/go-kube-downscaler
ghcr.io/caas-team/gokubedownscaler
tags: dev

- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
Expand Down Expand Up @@ -54,7 +65,9 @@ jobs:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.dev-meta.outputs.tags }}
- name: Sign Push
run: |
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/helm_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push helm chart

on:
repository_dispatch:
types: [build-new-chart]
types: [build-new-chart, create-dev-build]

jobs:
build_and_push:
Expand All @@ -26,6 +26,7 @@ jobs:
MTR: mtr.devops.telekom.de

- name: Helm Lint, Package, and Push
if: github.event.action == 'release-new-version'
run: |
cd deployments/chart
helm lint .
Expand All @@ -36,6 +37,18 @@ jobs:
MTR: mtr.devops.telekom.de
REPO: caas

- name: Helm Lint, Package, and Push Dev Build
if: github.event.action == 'create-dev-build'
run: |
cd deployments/chart
helm lint .
helm package . --version ${{ github.event.client_payload.version }} --app-version dev
helm push $(ls *.tgz | head -1) oci://ghcr.io/caas-team/charts
helm push $(ls *.tgz | head -1) oci://${MTR}/${REPO}/charts
env:
MTR: mtr.devops.telekom.de
REPO: caas

- name: Dispatch Event to Helm-Charts Repo
uses: peter-evans/repository-dispatch@v3
with:
Expand Down

0 comments on commit 2dc1666

Please sign in to comment.