fetch-versions #926
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: fetch-versions | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: execute py script | |
env: | |
GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }} | |
run: | | |
pip install -U pip | |
pip install pdm | |
pdm install | |
pdm run prisma db push | |
pdm cli fetch-versions | |
working-directory: backend | |
- name: commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add backend/db.sqlite | |
git diff --staged --quiet || git commit -m "bot: fetch versions" | |
- name: push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
deploy: | |
needs: [build] | |
name: deploy | |
uses: ./.github/workflows/deploy.yml | |
secrets: inherit |