publish #2214
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: publish | |
on: | |
schedule: | |
- cron: '0 9,21 * * MON-FRI' | |
- cron: '0 21 * * SUN' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: Install dependencies | |
run: | | |
sudo apt update -y | |
sudo apt install -y tree poppler-utils | |
uv sync --all-extras --dev | |
- name: Fetch translation cache | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: cache | |
sparse-checkout: en/translations.json | |
sparse-checkout-cone-mode: false | |
- name: Parse | |
run: ./scripts/parse.sh | |
env: | |
DEEPL_API_KEY: ${{ secrets.DEEPL_API_KEY }} | |
- name: Deploy | |
uses: docker://peaceiris/gh-pages:latest | |
env: | |
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: ./dist | |
with: | |
emptyCommits: false | |
keepFiles: true | |
if: github.ref == 'refs/heads/master' | |
- name: Minimize uv cache | |
run: uv cache prune --ci |