-
Notifications
You must be signed in to change notification settings - Fork 23
97 lines (90 loc) · 2.85 KB
/
github-pages.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Github Pages
on:
schedule:
- cron: "0 1 * * *"
push:
branches: [master]
permissions:
contents: write
pages: write
id-token: write
jobs:
Archiving:
runs-on: ubuntu-latest
env:
DEPLOY_USER_NAME: Deploy-GitHub-Action
DEPLOY_USER_EMAIL: [email protected]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: ./.github/actions/archiving-images
- uses: ./.github/actions/commit-if-change
with:
commit_user_name: $DEPLOY_USER_NAME
commit_user_email: $DEPLOY_USER_EMAIL
custom_commit_message: >
Auto archive image
Archive and Modify follow file:
- name: Push to remote
run: |
git pull --rebase origin master
git push origin master
Translating:
runs-on: ubuntu-latest
needs: Archiving
env:
DEPLOY_USER_NAME: Deploy-GitHub-Action
DEPLOY_USER_EMAIL: [email protected]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.ENCRYPTED_KEY }}
- uses: ./.github/actions/auto-translation
- uses: ./.github/actions/commit-if-change
with:
commit_user_name: $DEPLOY_USER_NAME
commit_user_email: $DEPLOY_USER_EMAIL
custom_commit_message: >
Auto translate
Generate follow file:
- name: Push to remote
run: |
git pull --rebase origin master
git push origin master
build_deploy:
runs-on: ubuntu-latest
needs: [Archiving, Translating]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{ github.ref }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
find _site -name '*html' -exec sed -i 's/tw\/zh-TW\/assets/tw\/assets/g' {} +
find _site -name '*html' -exec sed -i 's/tw\/en\/assets/tw\/assets/g' {} +
env:
JEKYLL_ENV: production
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site