Daily Repository Update #166
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: Daily Repository Update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 22 * * *' # JST 7:00 | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
TZ: 'Asia/Tokyo' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
fetch-depth: 0 # this is important to fetch all history | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.3' | |
cache: 'pip' # caching pip dependencies | |
- run: pip install -r autotrans/requirements.txt | |
- name: Pull latest from original | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git config pull.rebase false # merge | |
git remote add upstream https://github.com/pluralitybook/plurality.git | |
git pull upstream main | |
git push origin main | |
- name: Run translation | |
run: | | |
python autotrans/main.py | |
- name: Commit translation | |
run: | | |
autotrans/commit.sh |