Skip to content

Commit

Permalink
ci: add container publishing and helm chart updates on tagged release (
Browse files Browse the repository at this point in the history
  • Loading branch information
mindovermiles262 authored Jan 16, 2025
1 parent a0235d2 commit 799062a
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ permissions:
contents: write

jobs:
# # # # # # # # # # # # # # # # #
# Binaries & GH Releases
# # # # # # # # # # # # # # # # #
build-release-binaries:
name: Build Relase Binaries
runs-on: ubuntu-latest
Expand All @@ -32,7 +35,6 @@ jobs:
runs-on: ubuntu-latest
needs: [build-release-binaries]
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
# https://github.com/actions/download-artifact
- uses: actions/download-artifact@v4
Expand All @@ -43,4 +45,66 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: build/release.sh $GH_TAG

# # # # # # # # # # # # # # # # #
# Update Helm Chart
# # # # # # # # # # # # # # # # #
update-helm-chart-version:
name: Update Helm Chart Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Chart
# https://github.com/marketplace/actions/github-push
run: |
CAPTURE_GROUP="appVersion:\ \"v[0-9]\+\.[0-9]\+\.[0-9]\+\""
REPLACEMENT="appVersion\:\ \"$GH_TAG\""
echo "Updating Piko Helm Chart to Version $GH_TAG"
sed -i'' "s/$CAPTURE_GROUP/$REPLACEMENT/" $GITHUB_WORKSPACE/operations/helm/piko/Chart.yaml
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "[bot] bump helm chart to version $GH_TAG"
git push origin HEAD:main
# # # # # # # # # # # # # # # # #
# Build & Publish Containers
# # # # # # # # # # # # # # # # #
docker-containers:
name: Build & Publish Containers
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Docker Tags
# https://github.com/docker/metadata-action
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{github.actor}}/piko

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
build-args: version=$GH_TAG
file: build/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 799062a

Please sign in to comment.