Snowflake table daily backup for 2025-08-03 #75
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: Consolidate Bitcoin Data | |
| on: | |
| push: | |
| paths: | |
| - 'btc_ohclv_*.csv' # Se déclenche seulement pour les fichiers daily | |
| branches: | |
| - main # Changez si votre branche principale a un autre nom | |
| jobs: | |
| consolidate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| pip install pandas | |
| - name: Run consolidation script | |
| run: | | |
| python consolidate_bitcoin_data.py | |
| - name: Check for changes | |
| id: verify-changed-files | |
| run: | | |
| if git diff --quiet btc-hourly-price_2015_2025.csv; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Delete btc_ohclv_* files | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| # Remove all btc_ohclv_* files | |
| rm -f btc_ohclv_*.csv | |
| echo "Deleted btc_ohclv_* files" | |
| - name: Commit and push updated file | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add btc-hourly-price_2015_2025.csv | |
| git add -u # This stages deleted files | |
| git commit -m "Auto-update consolidated Bitcoin data and cleanup daily files" | |
| git push |