ci: publish chart on chart.yaml changes only (#873)

* ci: clean up of workflows in general
This commit is contained in:
Callum Tait
2021-10-05 22:28:05 +01:00
committed by GitHub
parent 0a3d2b686e
commit b01e193aab
7 changed files with 37 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ on:
paths:
- 'runner/**'
- .github/workflows/build-and-release-runners.yml
- '!**.md'
push:
branches:
- master
@@ -17,6 +18,7 @@ on:
- runner/Dockerfile.dindrunner
- runner/entrypoint.sh
- .github/workflows/build-and-release-runners.yml
- '!**.md'
env:
RUNNER_VERSION: 2.283.3

View File

@@ -79,8 +79,22 @@ jobs:
run: ct install --config charts/.ci/ct-config.yaml
if: steps.list-changed.outputs.changed == 'true'
publish-chart:
# WARNING: This relies on the latest release being inat the top of the JSON from GitHub and a clean chart.yaml
- name: Check if Chart Publish is Needed
id: publish-chart
run: |
CHART_TEXT=$(curl -fs https://raw.githubusercontent.com/actions-runner-controller/actions-runner-controller/master/charts/actions-runner-controller/Chart.yaml)
NEW_CHART_VERSION=$(echo "$CHART_TEXT" | grep version: | cut -d ' ' -f 2)
RELEASE_LIST=$(curl -fs https://api.github.com/repos/actions-runner-controller/actions-runner-controller/releases | jq .[].tag_name | grep actions-runner-controller | cut -d '"' -f 2 | cut -d '-' -f 4)
LATEST_RELEASED_CHART_VERSION=$(echo $RELEASE_LIST | cut -d ' ' -f 1)
echo "Chart version in master : $NEW_CHART_VERSION"
echo "Latest release chart version : $LATEST_RELEASED_CHART_VERSION"
if [[ $NEW_CHART_VERSION != $LATEST_RELEASED_CHART_VERSION ]]; then
echo "::set-output name=publish::true"
fi
publish-chart:
if: steps.publish-chart.outputs.publish == 'true'
runs-on: ubuntu-latest
needs: lint-chart

View File

@@ -1,3 +1,5 @@
name: Publish Controller Image
on:
release:
types: [published]

View File

@@ -7,6 +7,7 @@ on:
paths:
- 'runner/**'
- 'test/entrypoint/**'
- '!**.md'
jobs:
test:

View File

@@ -5,10 +5,15 @@ on:
branches:
- master
paths-ignore:
- 'runner/**'
- .github/workflows/build-and-release-runners.yml
- '*.md'
- '.gitignore'
- .github/workflows/build-and-release-runners.yml
- .github/workflows/on-push-lint-charts.yml
- .github/workflows/on-push-master-publish-chart.yml
- .github/workflows/release.yml
- .github/workflows/test-entrypoint.yml
- .github/workflows/wip.yml
- 'runner/**'
- '**.md'
- '.gitignore'
jobs:
test:

View File

@@ -1,8 +1,15 @@
name: Publish Canary Image
on:
push:
branches:
- master
paths-ignore:
- .github/workflows/build-and-release-runners.yml
- .github/workflows/on-push-lint-charts.yml
- .github/workflows/on-push-master-publish-chart.yml
- .github/workflows/release.yml
- .github/workflows/test-entrypoint.yml
- "runner/**"
- "**.md"
- ".gitignore"