Blog Localization #1054
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: Blog Localization | |
on: | |
# allows to manually run the job at any time | |
workflow_dispatch: | |
# # run on every push on the release branch | |
# push: | |
# branches: [production, staging, master, refactor/**] | |
permissions: | |
contents: write | |
pull-requests: write | |
# Add concurrency group to queue builds | |
concurrency: | |
group: blog-sync | |
cancel-in-progress: false # Queue instead of canceling | |
env: | |
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }} | |
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
jobs: | |
sync-blog: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: "yarn" | |
- run: yarn install | |
- name: "Run sync command" | |
id: sync-command | |
run: yarn gen:all | |
continue-on-error: true | |
- name: "Run sync command again if failed (#2)" | |
id: sync-command-again | |
if: steps.sync-command.outcome == 'failure' | |
run: yarn gen:all | |
continue-on-error: true | |
- name: "Run sync command again if failed (#3)" | |
id: sync-command-again-2 | |
if: steps.sync-command-again.outcome == 'failure' | |
run: yarn gen:all | |
continue-on-error: true | |
- name: "Run sync command again if failed (#4)" | |
id: sync-command-again-3 | |
if: steps.sync-command-again-2.outcome == 'failure' | |
run: yarn gen:all | |
continue-on-error: true | |
- name: "Run sync command again if failed (#5)" | |
id: sync-command-again-4 | |
if: steps.sync-command-again-3.outcome == 'failure' | |
run: yarn gen:all | |
- name: "Commit sync contents" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "[GitHub Action] Sync blog contents from AFFiNE Cloud" | |
file_pattern: "content/blog/*.json content/templates/*.json content/changelogs/*.json public/rss.xml public/sitemap.xml" |