From cd20313044c114dc9da60cafdf4116d59441b887 Mon Sep 17 00:00:00 2001 From: Evan Hearne Date: Wed, 15 May 2024 13:43:24 +0100 Subject: [PATCH] created dashboard github action --- .github/workflows/upload-dashboards.yaml | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/upload-dashboards.yaml diff --git a/.github/workflows/upload-dashboards.yaml b/.github/workflows/upload-dashboards.yaml new file mode 100644 index 000000000..c0179a179 --- /dev/null +++ b/.github/workflows/upload-dashboards.yaml @@ -0,0 +1,35 @@ +name: Upload Dashboards + +on: + push: + branches: + - main + paths: + - examples/dashboards/app_developer.json + - examples/dashboards/business_user.json + - examples/dashboards/platform_engineer.json + +jobs: + upload-dashboards: + name: Upload Dashboards + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + - name: Upload Dashboard + run: | + # Push new dashboard changes + + # Init variable with base64 auth + auth=$(echo -n ${{ secrets.GRAFANA_USERNAME }}:${{ secrets.GRAFANA_PASSWORD }} | base64) + + # App Developer Dashboard + curl -X POST -F "json=@./examples/dashboards/app_developer.json" -H 'Content-Type: multipart/form-data' -H "Authorization: Basic $auth" "https://www.grafana.com/api/dashboards/20970/revisions" + + # Business User Dashboard + curl -X POST -F "json=@./examples/dashboards/business_user.json" -H 'Content-Type: multipart/form-data' -H "Authorization: Basic $auth" "https://www.grafana.com/api/dashboards/20981/revisions" + + # Platform Engineer Dashboard + curl -X POST -F "json=@./examples/dashboards/platform_engineer.json" -H 'Content-Type: multipart/form-data' -H "Authorization: Basic $auth" "https://www.grafana.com/api/dashboards/20982/revisions"