From 8b8a42c18c2aff291b833e9f51fdfab068a708c5 Mon Sep 17 00:00:00 2001 From: Lasse Gaardsholt Date: Thu, 12 Oct 2023 21:30:30 +0200 Subject: [PATCH 1/3] can we cheat? --- .github/workflows/lint-test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index ab110d8..1a2a500 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -1,9 +1,10 @@ name: Lint and Test Charts on: - push: - branches: - - "*" + workflow_run: + workflows: [Build image and push to GHCR] + types: + - completed jobs: lint-test: From 9d0996eaff6e852c9b3a006b87403405bc50671d Mon Sep 17 00:00:00 2001 From: Lasse Gaardsholt Date: Thu, 12 Oct 2023 21:35:31 +0200 Subject: [PATCH 2/3] more cheating --- .github/workflows/build_container.yml | 10 +++++++--- .github/workflows/lint-test.yaml | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml index a4769a0..36a785e 100644 --- a/.github/workflows/build_container.yml +++ b/.github/workflows/build_container.yml @@ -3,7 +3,9 @@ name: Build image and push to GHCR on: push: tags: - - 'v*' + - "v*" + branches: + - "*" jobs: build-and-push-image: @@ -13,7 +15,7 @@ jobs: packages: write defaults: run: - working-directory: '.' + working-directory: "." steps: - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -31,9 +33,11 @@ jobs: with: # list of Docker images to use as base name for tags images: | - ghcr.io/orkarstoft/kscale + ghcr.io/bestseller/nightscaler # generate Docker tags based on the following events/attributes tags: | + type=ref,event=branch + type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 1a2a500..97b2fb0 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -9,6 +9,7 @@ on: jobs: lint-test: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout uses: actions/checkout@v3 @@ -22,7 +23,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: "3.9" check-latest: true - name: Set up chart-testing @@ -46,4 +47,4 @@ jobs: - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --config ct.yaml --target-branch ${{ github.event.repository.default_branch }} \ No newline at end of file + run: ct install --config ct.yaml --helm-extra-set-args "--set=image.tag=${GITHUB_REF#refs/heads/}" --target-branch ${{ github.event.repository.default_branch }} From c48e54013d7b2d9401505ad3192ea4d927905c27 Mon Sep 17 00:00:00 2001 From: Lasse Gaardsholt Date: Thu, 12 Oct 2023 21:41:07 +0200 Subject: [PATCH 3/3] I don't understand why it doesn't work... --- .github/workflows/lint-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 97b2fb0..6fe101c 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -2,7 +2,7 @@ name: Lint and Test Charts on: workflow_run: - workflows: [Build image and push to GHCR] + workflows: ["Build image and push to GHCR"] types: - completed