-
Notifications
You must be signed in to change notification settings - Fork 108
62 lines (56 loc) · 1.95 KB
/
blog-localization.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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"