fix Netlify deployment #1077
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: Translate | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
translate: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "19" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm i opencc glob | |
- name: Translate | |
run: npm run translate | |
# Commit all changed files back to the repository | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Translate content in Traditional Chinese | |
file_pattern: 'content/*.md' |