myr-academy-update #101570
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
| # This workflow will update the old Academy every 10 minutes | |
| name: myr-academy-update | |
| on: | |
| schedule: | |
| - cron: "*/10 * * * *" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Make dirs | |
| run: | | |
| mkdir myr | |
| mkdir academy | |
| - name: Clone Myr repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: 'Pauperformance/pauperformance-bot' | |
| ref: 'master' | |
| path: './myr' | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Set up Python 3 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Myr | |
| run: | | |
| pushd myr | |
| python -m venv venv | |
| source venv/bin/activate | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install . | |
| popd | |
| - name: Clone Academy repository | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: 'master' | |
| path: './academy' | |
| - name: Get current date | |
| id: date | |
| run: echo "::set-output name=today::$(date +'%Y-%m-%d, %H:%M:%S')" | |
| - name: Update Academy | |
| env: | |
| DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | |
| DROPBOX_APP_KEY: ${{ secrets.DROPBOX_APP_KEY }} | |
| DROPBOX_APP_SECRET: ${{ secrets.DROPBOX_APP_SECRET }} | |
| DROPBOX_REFRESH_TOKEN: ${{ secrets.DROPBOX_REFRESH_TOKEN }} | |
| MTGGOLDFISH_PAUPERFORMANCE_PASSWORD: ${{ secrets.MTGGOLDFISH_PAUPERFORMANCE_PASSWORD }} | |
| MTGGOLDFISH_PAUPERFORMANCE_USERNAME: ${{ secrets.MTGGOLDFISH_PAUPERFORMANCE_USERNAME }} | |
| TWITCH_APP_CLIENT_ID: ${{ secrets.TWITCH_APP_CLIENT_ID }} | |
| TWITCH_APP_CLIENT_SECRET: ${{ secrets.TWITCH_APP_CLIENT_SECRET }} | |
| YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
| run: | | |
| source myr/venv/bin/activate | |
| ACADEMY_PATH="$(pwd)/academy" | |
| export ACADEMY_PATH | |
| myr academy update | |
| - name: Push changes | |
| run: | | |
| pushd academy | |
| git config --local user.email "ShadowTemplate@users.noreply.github.com" | |
| git config --local user.name "Myr" | |
| git status | |
| git --no-pager diff | |
| git diff --quiet HEAD || (git commit -am "Myr update: ${{ steps.date.outputs.today }}" && git push) | |
| [[ `git ls-files . --exclude-standard --others` ]] && git add . && git commit -am "Myr update: ${{ steps.date.outputs.today }}" && git push | |
| popd |