.github/workflows/translations.yml #17
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
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
translations: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Initialize project | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build | |
- name: Fetch sources | |
run: | | |
wget https://github.com/tldr-pages/tldr/archive/refs/heads/main.zip --output-document /tmp/main.zip | |
unzip /tmp/main.zip -d /tmp | |
- name: Execute | |
run: | | |
npm run tldr-translation-pairs-gen -- --source /tmp/tldr-main --output /tmp/datasets | |
- name: Package artifacts | |
run: | | |
mkdir /tmp/dist | |
tar czf /tmp/dist/tldr-pages-translation-pairs.tar.gz --directory /tmp datasets | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: /tmp/dist | |
deploy: | |
needs: translations | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |