Deploy grafana dashboards #650
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy grafana dashboards | |
| on: | |
| schedule: | |
| # Run at 05:00 every day, ref: https://crontab.guru/#0_5_*_*_* | |
| - cron: 0 5 * * * | |
| workflow_dispatch: | |
| jobs: | |
| identify_clusters: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| matrix: ${{ steps.matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Build matrix | |
| id: matrix | |
| run: | | |
| # Find names of clusters from `cluster.yaml` entries | |
| echo "matrix=$(yq -I=0 -o json eval-all '[{"cluster_name": .name}]' config/clusters/*/cluster.yaml)" | \ | |
| tee --append "$GITHUB_OUTPUT" | |
| deploy_grafana_dashboards: | |
| runs-on: ubuntu-22.04 | |
| needs: identify_clusters | |
| strategy: | |
| # Don't stop other deployments if one fails | |
| fail-fast: false | |
| matrix: | |
| include: ${{fromJson(needs.identify_clusters.outputs.matrix)}} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Install deployer | |
| run: | | |
| python3 -m pip install --editable . | |
| - name: Install jsonnet (go-jsonnet) | |
| run: | | |
| JSONNET_VERSION=0.20.0 | |
| wget -qO- https://github.com/google/go-jsonnet/releases/download/v${JSONNET_VERSION}/go-jsonnet_${JSONNET_VERSION}_Linux_x86_64.tar.gz \ | |
| | tar -xvz --one-top-level=$HOME/.local/bin | |
| - name: Install sops | |
| uses: mdgreenwald/[email protected] | |
| - name: Setup sops credentials to decrypt repo secrets | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: ${{ secrets.GCP_KMS_DECRYPTOR_KEY }} | |
| - name: Deploy grafana dashboards for ${{ matrix.cluster_name }} | |
| run: | | |
| deployer deploy-dashboards ${{ matrix.deploy_flags }} ${{ matrix.cluster_name }} |