Skip to content

Commit

Permalink
Merge branch 'feature/helm-workflow'
Browse files Browse the repository at this point in the history
This merge pulls in the addition of a github workflow that should have
been included in the last release. It also models a slightly simplified
git workflow by leaving out the intermediary step of a devel branch.
Also included is a version bump 0.0.5->0.0.6

Signed-off-by: Adam McCartney <adam@mur.at>
  • Loading branch information
adammccartney committed Jan 19, 2023
2 parents 759f062 + b7146f8 commit 770b43d
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Helm-Release

on: [ release ]

## REF: https://faun.pub/semantic-version-of-helm-charts-in-github-actions-using-conventional-commits-ce5e0a587ce8
jobs:
publish-helm-chart:
runs-on: ubuntu-latest

steps:
- name: Checkout source code # Checkout source code
uses: 'actions/checkout@v2'
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Get specific changed files # To check if any files changed in charts/ots directory
id: changed-files-specific
uses: tj-actions/changed-files@v14.5
with:
since_last_remote_commit: true
files: |
Charts/pacman/*
- name: Automated Version Bump # Bump version in package.json
if: steps.changed-files-specific.outputs.any_modified == 'true'
id: version-bump
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGEJSON_DIR: 'Charts/pacman'
with:
skip-tag: 'true'
commit-message: 'CI: Bump Helm chart version to {{version}}'

- name: update Chart.yaml # Update chart.yaml with new version and other fields
if: steps.changed-files-specific.outputs.any_modified == 'true'
working-directory: Charts/pacman
run: |
sed -i'.oldVersion' -e "/^version:/s;[^ ]*$;${{ steps.version-bump.outputs.newTag }};" Chart.yaml
sed -i'.oldAppVersion' -e "/^appVersion:/s;[^ ]*$;${{ steps.version-bump.outputs.newTag }};" Chart.yaml
- name: commit the new Chart.yml # commit the new Chart.yaml to main branch
if: steps.changed-files-specific.outputs.any_modified == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated Change

- name: Run chart-releaser
if: steps.changed-files-specific.outputs.any_modified == 'true'
uses: helm/chart-releaser-action@v1.4.0
with:
charts_dir: Charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion Charts/pacman/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.5"
appVersion: "0.0.6"
2 changes: 1 addition & 1 deletion Charts/pacman/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replicaCount: 1
image:
repository: ghcr.io/austriandatalab/pacman
pullPolicy: IfNotPresent
tag: "v0.0.5"
tag: "v0.0.6"

imagePullSecrets: []
nameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion Documentation/localdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ named app and db.
```yaml
services:
app:
image: ghcr.io/austriandatalab/pacman:v0.0.5
image: ghcr.io/austriandatalab/pacman:v0.0.6
container_name: adls-pacman-app
env_file:
- local-dev-app.env
Expand Down
2 changes: 1 addition & 1 deletion deployments/pacman-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
name: pacman
spec:
containers:
- image: ghcr.io/austriandatalab/pacman:v0.0.5
- image: ghcr.io/austriandatalab/pacman:v0.0.6
name: pacman
ports:
- containerPort: 8080
Expand Down
2 changes: 1 addition & 1 deletion localdev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
app:
image: ghcr.io/austriandatalab/pacman:v0.0.5
image: ghcr.io/austriandatalab/pacman:v0.0.6
container_name: adls-pacman-app
env_file:
- local-dev-app.env
Expand Down

0 comments on commit 770b43d

Please sign in to comment.