Update sources #8922
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: Update sources | |
| # Run on push and 4 times per day | |
| on: | |
| schedule: | |
| - cron: 0 0,6,12,18 * * * | |
| workflow_dispatch: | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| container: universalteam/db | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Delete old pages and QRs | |
| run: rm -rf docs/_3ds/* docs/_ds/* docs/assets/images/qr/*.png docs/assets/images/qr/nightly/*.png docs/assets/images/qr/prerelease/*.png | |
| - name: Run generate.py | |
| env: | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} | |
| run: | | |
| export PATH=$PATH:/opt/devkitpro/tools/bin | |
| python3 source/generate.py all | |
| # Pull origin in case a commit has been done while updating | |
| - name: Pull origin | |
| run: | | |
| git config --global --add safe.directory /__w/db/db | |
| git pull origin master --ff-only | |
| - name: Push changes | |
| run: | | |
| git config user.email "twlbot@flashcarts.net" | |
| git config user.name "TWLBot" | |
| echo "machine github.com" > "$HOME/.netrc" | |
| echo " login TWLBot" >> "$HOME/.netrc" | |
| echo " password ${{ secrets.GITHUB_TOKEN }}" >> "$HOME/.netrc" | |
| echo "machine api.github.com" >> "$HOME/.netrc" | |
| echo " login TWLBot" >> "$HOME/.netrc" | |
| echo " password ${{ secrets.GITHUB_TOKEN }}" >> "$HOME/.netrc" | |
| git checkout master | |
| git stage . | |
| if git commit -m "Update sources"; then | |
| git push origin master | |
| fi |