diff --git a/.github/workflows/bundle-push.yaml b/.github/workflows/bundle-push.yaml index 3f8f21a..578d207 100644 --- a/.github/workflows/bundle-push.yaml +++ b/.github/workflows/bundle-push.yaml @@ -11,7 +11,7 @@ on: workflow_dispatch: jobs: - container: + bundle: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/check-upstream.yaml b/.github/workflows/check-upstream.yaml new file mode 100644 index 0000000..3f29809 --- /dev/null +++ b/.github/workflows/check-upstream.yaml @@ -0,0 +1,47 @@ +name: Check Upstream Chart Version +on: + schedule: 0 8 * * 1 + workflow_dispatch: + +jobs: + check-local-version: + name: Check Local Version + runs-on: ubuntu-latest + outputs: + update: ${{ steps.compare.outputs.update }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Helm Install + uses: azure/setup-helm@v3 + + - name: Compare Versions + id: compare + run: | + CHART_PATH="simple-arc-operator/helm-charts/actions-runner-controller/Chart.yaml" + LOCAL_VERSION=$(grep -Po "(?<=version: )(\d+.?){3}" $CHART_PATH) + + helm repo add actions-runner-controller \ + https://actions-runner-controller.github.io/actions-runner-controller + + helm repo update + + UPSTREAM_VERSION=$(helm search repo actions-runner-controller -o json | jq -r .[0].version) + + if [ "$LOCAL_VERSION" == "$UPSTREAM_VERSION" ]; then + echo "Versions match" + echo "update=false" >> $GITHUB_OUTPUT + else + echo "Versions do not match" + echo "update=true" >> $GITHUB_OUTPUT + fi + + echo "Local: $LOCAL_VERSION" + echo "Upstream: $UPSTREAM_VERSION" + + generate-operator: + needs: check-local-version + if: needs.check-local-version.outputs.update == 'true' + uses: ./.github/workflows/generate-operator.yaml diff --git a/.github/workflows/generate-operator.yaml b/.github/workflows/generate-operator.yaml index 633303d..66bd203 100644 --- a/.github/workflows/generate-operator.yaml +++ b/.github/workflows/generate-operator.yaml @@ -1,12 +1,9 @@ -name: GitHub Actions Demo +name: Generate Operator on: - push: - branches: - - codify-changes - workflow_dispatch: + workflow_call: jobs: - containers: + generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/runner-test.yaml b/.github/workflows/runner-test.yaml index 4bd1b6c..15eb4da 100644 --- a/.github/workflows/runner-test.yaml +++ b/.github/workflows/runner-test.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: jobs: - container: + test: runs-on: ['self-hosted', 'Linux', 'X64'] steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."