Fetch and Commit DB Dump #389
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: Fetch and Commit DB Dump | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs daily at midnight | |
| jobs: | |
| fetch-and-commit: | |
| runs-on: ubuntu-latest | |
| env: | |
| url: "https://s3.amazonaws.com/wikia_xml_dumps/y/yo/youtube_pages_full.xml.7z" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| - name: Download file using cURL | |
| run: curl -L -o db-dump/youtube_pages_full.xml.7z ${{ env.url }} | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git add db-dump/* | |
| git commit -m "Update database dump" || echo "Nothing to commit, working tree clean" | |
| git push origin main || echo "Push failed" |