From af46ce4c6ac6e4b7b30c7a89cf3d6068b7568f3e Mon Sep 17 00:00:00 2001 From: anuttinck Date: Tue, 13 Aug 2024 15:48:02 +0200 Subject: [PATCH] [MOD] gha workflows by using IMIO/gha --- .github/workflows/release.yaml | 32 +++++++++-------------------- .github/workflows/test-pr.yaml | 15 ++++++++++++++ .github/workflows/test.yaml | 37 ++++++++-------------------------- 3 files changed, 32 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/test-pr.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ec8ed2a..1fc52a0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 \ No newline at end of file + 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 diff --git a/.github/workflows/test-pr.yaml b/.github/workflows/test-pr.yaml new file mode 100644 index 0000000..32a58fe --- /dev/null +++ b/.github/workflows/test-pr.yaml @@ -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/helm-test-notify@v3.9.2 + with: + HELM_RELEASE: plausible-analytics + HELM_NAMESPACE: plausible-analytics + \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f4f7376..cb852e4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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/chart-testing-action@v2.6.0 - - - name: Run chart-testing (lint) - run: ct lint --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }} - - - name: Create kind cluster - uses: helm/kind-action@v1.7.0 - - - 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 }}