-
Notifications
You must be signed in to change notification settings - Fork 84
119 lines (110 loc) · 4.84 KB
/
main.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build/deploy jekyll site and sync release to next-release
on:
push:
branches:
- release
jobs:
build_and_deploy_site:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Retrieve po4a installation cache or create it if not found:
- name: Check for po4a cache
uses: actions/cache@v3
id: cache-po4a
with:
path: "~/po4a"
key: ${{ runner.os }}-po4a-0.68
- name: Install or retrieve po4a from cache
env:
CACHE_HIT: ${{steps.cache-po4a.outputs.cache-hit}}
# If CACHE_HIT: true, retrieve the cache. If not, install po4a and its dependencies and copy them all to a folder (~/po4a/) to be cached:
run: ./_po4a-tools/po4a-cache.sh
# Paths changes filter. If there's been a change to any files defined in the filter, the step (update .po files) runs:
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
src_files_changed:
- 'wiki/en/**'
- name: Update .po files
if: steps.filter.outputs.src_files_changed == 'true'
run: ./_po4a-tools/po4a-update-templates.sh
# This step only runs if a PR is merged:
- name: Push changes to repo if action triggered on:push and .po files need updating
if: ${{ steps.filter.outputs.src_files_changed == 'true' }}
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'AUTO: Update .po files'
# Create target translated files. Never pushed to the repo.
- name: Create translated docs and stats
run: ./_po4a-tools/po4a-create-all-targets.sh
# Build and deploy site
- name: 💎 setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3 # can change this to 2.7 or whatever version you prefer
- name: 🔨 install dependencies & build site
uses: limjh16/jekyll-action-ts@v2
with:
enable_cache: true
### Enables caching. Similar to https://github.com/actions/cache.
#
#format_output: false
### Uses prettier https://prettier.io to format jekyll output HTML.
#
# prettier_opts: '{ "useTabs": true }'
### Sets prettier options (in JSON) to format output HTML. For example, output tabs over spaces.
### Possible options are outlined in https://prettier.io/docs/en/options.html
#
# prettier_ignore: 'about/*'
### Ignore paths for prettier to not format those html files.
### Useful if the file is exceptionally large, so formatting it takes a while.
### Also useful if HTML compression is enabled for that file / formatting messes it up.
#
# jekyll_src: sample_site
### If the jekyll website source is not in root, specify the directory. (in this case, sample_site)
### By default, this is not required as the action searches for a _config.yml automatically.
#
# gem_src: sample_site
### By default, this is not required as the action searches for a _config.yml automatically.
### However, if there are multiple Gemfiles, the action may not be able to determine which to use.
### In that case, specify the directory. (in this case, sample_site)
###
### If jekyll_src is set, the action would automatically choose the Gemfile in jekyll_src.
### In that case this input may not be needed as well.
#
# key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
# restore-keys: ${{ runner.os }}-gems-
### In cases where you want to specify the cache key, enable the above 2 inputs
### Follows the format here https://github.com/actions/cache
#
# custom_opts: '--drafts --lsi'
### If you need to specify any Jekyll build options, enable the above input
### Flags accepted can be found here https://jekyllrb.com/docs/configuration/options/#build-command-options
- name: 🚀 deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
# if the repo you are deploying to is <username>.github.io, uncomment the line below.
# if you are including the line below, make sure your source files are NOT in the main branch:
# publish_branch: main
sync-branch:
needs: build_and_deploy_site
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ${{ github.sha }} update from release
uses: devmasx/[email protected]
with:
type: now
from_branch: release
target_branch: next-release
github_token: ${{ github.token }}