https://github.com/zentered/grafana-backup-action
Fetch Grafana dashboards and save them to a local directory
https://github.com/zentered/grafana-backup-action
Last synced: about 1 year ago
JSON representation
Fetch Grafana dashboards and save them to a local directory
- Host: GitHub
- URL: https://github.com/zentered/grafana-backup-action
- Owner: zentered
- License: mit
- Created: 2023-03-09T10:36:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T03:44:06.000Z (over 2 years ago)
- Last Synced: 2025-04-02T23:05:58.489Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 367 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Grafana Backup Action
[](https://github.com/zentered/grafana-backup/actions/workflows/publish.yml)
This is a simple GitHub Action to backup Grafana Cloud dashboards.
## Usage
- `GRAFANA_CLOUD_API_KEY` - your Grafana Cloud API key
- `GRAFANA_ORG` - the Grafana organization name
- `OUTPUT_FOLDER` - the folder to save the dashboards to (ie: `backup`)
- `OVERWRITE_FILES` - true to overwrite/update files, false to create
date-stamped sub-folders
### GitHub Actions
Create a new repository and add the following workflow file to
`.github/workflows/grafana-backup.yml`:
```
name: Grafana Backup
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
jobs:
grafana-backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Grafana Backup
uses: zentered/grafana-backup@v1.0.2
env:
GRAFANA_CLOUD_API_KEY: ${{ secrets.GRAFANA_CLOUD_API_KEY }}
GRAFANA_ORG: ''
OUTPUT_FOLDER: ''
OVERWRITE_FILES: true
- uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
```
### Local
Add your API key and the organization name to `.env` (see `.env.example`).
Run `pnpm start` to backup all dashboards to `backup`.
## License
Licensed under [MIT](./LICENSE).