diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 15eb9c3a..5bc88c71 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,11 +2,16 @@ name: Plugins - CI on: push: - branches: - - main + branches: [main] pull_request: -permissions: {} +permissions: + contents: read + id-token: write + +concurrency: + group: plugins-ci-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: ci: @@ -22,7 +27,7 @@ jobs: plugin-version-suffix: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }} publish-latest-to-catalog: - name: Publish `main` to Dev Catalog + name: Publish main to Dev Catalog if: github.ref == 'refs/heads/main' uses: grafana/plugin-ci-workflows/.github/workflows/cd.yml@ci-cd-workflows/v5.1.0 permissions: @@ -38,3 +43,42 @@ jobs: plugin-version-suffix: ${{ github.sha }} run-playwright: false scopes: grafana_cloud_instance_datasourcese2e + + trigger-argo-workflow: + name: Trigger Argo Workflow + runs-on: ubuntu-24.04 + timeout-minutes: 10 + if: github.ref == 'refs/heads/main' + needs: publish-latest-to-catalog + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Read plugin ID + id: plugin + shell: bash + run: | + set -euo pipefail + echo "id=$(jq -er .id ./src/plugin.json)" >> "$GITHUB_OUTPUT" + + - name: Read package version + id: pkg + shell: bash + run: | + set -euo pipefail + echo "version=$(jq -er .version ./package.json)" >> "$GITHUB_OUTPUT" + + - name: Trigger workflow + uses: grafana/shared-workflows/actions/trigger-argo-workflow@d29b9161f1803baed4a7305c85cb5a3018bc3c3e # trigger-argo-workflow/v1.2.1 + with: + instance: ops + namespace: grafana-datasources-cd + workflow_template: ${{ steps.plugin.outputs.id }} + parameters: | + dockertag=${{ steps.pkg.outputs.version }}-${{ github.sha }} + prCommentContext="triggered-by-push-to-main datasource=${{ steps.plugin.outputs.id }}" + commit_author="grafana-delivery-bot"