Update Hearthbot Database #1893
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: Update Hearthbot Database | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '15 0,2 * * *' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Update dependencies | |
run: | | |
poetry update hearthstone | |
poetry update hearthstone-data | |
poetry export -o requirements.txt | |
- name: Update submodules | |
run: | | |
git submodule update --init --recursive | |
git submodule update --remote --recursive | |
- name: Commit | |
run: | | |
git config --global user.email zelknow@outlook.com | |
git config --global user.name ZelKnow | |
git add . | |
if [ -z "$(git status --porcelain)" ]; then | |
exit 0 | |
fi | |
git commit -m "✨feat: Hearthstone update" | |
- name: Push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |