Skip to content

Commit

Permalink
fix: bump helm chart version
Browse files Browse the repository at this point in the history
fix: always build docker images on release

fix: bump helm chart version

chore: test workflow variables
  • Loading branch information
Richard87 authored Oct 14, 2024
1 parent fc75bca commit b934b29
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Docker Image
name: Build Dev Images

on:
release:
Expand All @@ -9,8 +9,6 @@ on:
push:
branches:
- main
tags:
- '**'
pull_request: {}
workflow_dispatch:

Expand Down Expand Up @@ -48,7 +46,6 @@ jobs:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=latest-{{date 'YYYYMMDDHHmmss'}}-{{sha}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: Release Helm

on:
push:
tags:
- '**'
branches:
- main

permissions:
contents: write
pull-requests: write

name: Release

jobs:

build-helm-chart:
name: Build Helm chart
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
54 changes: 52 additions & 2 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,61 @@ permissions:
contents: write
pull-requests: write

name: release-please
name: Release

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
released: ${{ steps.release.outputs.releases_created }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: googleapis/release-please-action@v4
id: release


build-container-image:
name: Build container image
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.released
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

steps:
- name: Check out code
uses: actions/checkout@v4

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

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=latest-{{date 'YYYYMMDDHHmmss'}}-{{sha}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{needs.release-please.outputs.version}}"
platforms: |
linux/amd64
linux/arm64
3 changes: 1 addition & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
".": "1.3.0",
"charts/radix-prometheus-proxy": "1.1.0"
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ Currently this exports uptime statistics using the `probe_success` metric from p
## How we work

Commits to the main branch must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and uses Release Please to create new versions.

# TODO:

- Manually patch helm chart based on please-release output
- Manually tag docker image based on please-release output
15 changes: 0 additions & 15 deletions charts/radix-prometheus-proxy/CHANGELOG.md

This file was deleted.

12 changes: 7 additions & 5 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"packages": {
"charts/radix-prometheus-proxy": {
"release-type": "helm",
"package-name": "radix-prometheus-proxy-chart"
},
".": {
"changelog-path": "CHANGELOG.md",
"initial-version": "0.1.0",
"release-type": "simple"
"release-type": "simple",
"extra-files": [
{
"type": "yaml",
"path": "charts/radix-prometheus-proxy/Chart.yaml",
"jsonpath": "$.version"
}]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
Expand Down

0 comments on commit b934b29

Please sign in to comment.