Skip to content

Commit

Permalink
[MOD] gha workflows by using IMIO/gha
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Aug 13, 2024
1 parent e7a8a2c commit af46ce4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 52 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,15 @@ jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
runs-on:
group: self-hosted
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Helm Release
uses: IMIO/gha/helm-release-notify@v3.9.2
with:
fetch-depth: 0
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "helm-charts"
- name: Publish Helm chart
uses: tylerauerbeck/helm-gh-pages@main
with:
token: ${{ steps.app-token.outputs.token }}
charts_dir: .
index_dir: .
charts_url: https://imio.github.io/helm-charts/
owner: IMIO
repository: helm-charts
branch: gh-pages
target_dir: plausible-analytics
dependencies: bitnami,https://charts.bitnami.com/bitnami
TARGET_DIR: plausible-analytics
MATTERMOST_WEBHOOK_URL: ${{ secrets.COMMON_MATTERMOST_WEBHOOK_URL }}
APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
HELM_DEPENDENCIES: bitnami,https://charts.bitnami.com/bitnami
15 changes: 15 additions & 0 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Lint and Test Charts on PR

on: [pull_request]

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Lint and Test Charts
uses: IMIO/gha/[email protected]
with:
HELM_RELEASE: plausible-analytics
HELM_NAMESPACE: plausible-analytics

37 changes: 8 additions & 29 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
---
name: Lint and Test Charts

on: [pull_request, push, workflow_dispatch]
on: [push, workflow_dispatch]

jobs:
lint-test:
runs-on: ubuntu-latest
runs-on:
group: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint and Test Charts
uses: IMIO/gha/helm-test-notify@v3.9.2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.3

- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
uses: helm/[email protected]

- name: Run chart-testing (install)
# run: ct install --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }}
# can't use it until https://github.com/helm/chart-testing/issues/310 is resolved
run: helm install plausible-analytics . -f values.yaml --namespace plausible-analytics --create-namespace
HELM_RELEASE: plausible-analytics
HELM_NAMESPACE: plausible-analytics
MATTERMOST_WEBHOOK_URL: ${{ secrets.COMMON_MATTERMOST_WEBHOOK_URL }}

0 comments on commit af46ce4

Please sign in to comment.