Get Dashboards updates #74
This file contains 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: Get Dashboards updates | |
on: | |
push: | |
branches: | |
- dev | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
update-dashboards: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Current Repository | |
uses: actions/checkout@v4 | |
with: | |
path: current-repo | |
- name: Checkout Kexa Dashboards Repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'kexa-io/grafana-dashboards' | |
path: external-repo | |
- name: List Files in Repositories | |
run: | | |
echo "Listing files in current-repo:" | |
ls -R current-repo | |
echo "Listing files in external-repo:" | |
ls -R external-repo | |
shell: bash | |
- name: Create Target Directory | |
run: | | |
mkdir -p current-repo/charts/kexa-chart/files/dashboards | |
shell: bash | |
- name: Copy Files | |
run: | | |
cp -f external-repo/*.json current-repo/charts/kexa-chart/files/dashboards/ | |
shell: bash | |
- name: List Target Directory | |
run: | | |
echo "Files in target directory after copy:" | |
ls -R current-repo/charts/kexa-chart/files/dashboards/ | |
shell: bash | |
- name: Configure Git | |
run: | | |
git config --global user.name "Adrien E" | |
git config --global user.email "[email protected]" | |
working-directory: current-repo | |
- name: Commit changes | |
run: | | |
git add charts/kexa-chart/files/dashboards/ | |
if [ -n "$(git status --porcelain)" ]; then | |
git commit -m "Get new dashboards" | |
git push | |
else | |
echo "No changes to commit" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
working-directory: current-repo |