Skip to content

Commit

Permalink
Revert "Feat/refactor workflows (#42)" (#49)
Browse files Browse the repository at this point in the history
This reverts commit 8f06df4.
  • Loading branch information
JTaeuber authored Sep 16, 2024
1 parent 8f06df4 commit f85fdff
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 188 deletions.
85 changes: 0 additions & 85 deletions .github/workflows/check-for-release.yaml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/check_version.yaml

This file was deleted.

17 changes: 11 additions & 6 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Create new release
name: Create Release

on:
repository_dispatch:
types: [release-new-version]
push:
tags:
- "*"

jobs:
create_release:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write

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

- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: v${{ github.event.client_payload.appVersion }}
name: v${{ github.event.client_payload.appVersion }}
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generateReleaseNotes: true
33 changes: 29 additions & 4 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
# Build and push Image
name: Build and push Image

on:
repository_dispatch:
types: [release-new-version]
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check Version Format in Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: nowsprinting/[email protected]
id: check-version
with:
prefix: "v"

- name: Set tag
id: set-tag
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
TAG1="dev"
TAG2="commit-$SHORT_SHA"
if [[ "${{ steps.check-version.outputs.is_valid }}" == 'true' ]]; then
TAG1="latest"
TAG2="${{ steps.check-version.outputs.full_without_prefix }}"
fi
echo "TAG1=$TAG1" >> $GITHUB_ENV
echo "TAG2=$TAG2" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -16,8 +41,8 @@ jobs:
mtr.devops.telekom.de/caas/go-kube-downscaler
ghcr.io/caas-team/gokubedownscaler
tags: |
latest
${{ github.event.client_payload.version }}
${{ env.TAG1 }}
${{ env.TAG2 }}
- name: Install Cosign
uses: sigstore/cosign-installer@main
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/helm_build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Build and push helm chart
name: Build and Push Helm Package

on:
repository_dispatch:
types: [build-new-chart]
push:
tags:
- "*"

jobs:
build_and_push:
helm:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -21,13 +22,13 @@ jobs:
helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
helm registry login ${MTR} -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
MTR: mtr.devops.telekom.de

- name: Helm Lint, Package, and Push
run: |
cd deployments/chart
cd chart
helm lint .
helm package .
helm push $(ls *.tgz | head -1) oci://ghcr.io/caas-team/charts
Expand All @@ -36,10 +37,16 @@ jobs:
MTR: mtr.devops.telekom.de
REPO: caas

- name: Extract Chart Version
id: chart_version
run: |
version=$(yq e '.version' ./chart/Chart.yaml)
echo "::set-output name=version::$version"
- name: Dispatch Event to Helm-Charts Repo
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: caas-team/helm-charts
event-type: new-helm-chart-version
client-payload: '{"chart": "go-kube-downscaler", "version": "${{ github.event.client_payload.version }}"}'
client-payload: '{"chart": "go-kube-downscaler", "version": "${{ steps.chart_version.outputs.version }}"}'
4 changes: 2 additions & 2 deletions deployments/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: go-kube-downscaler
description: A Helm chart for deploying the go-kube-downscaler

type: application
version: 1.0.0
appVersion: 1.0.0
version: 0.0.0
appVersion: 0.0.0

0 comments on commit f85fdff

Please sign in to comment.