-
Notifications
You must be signed in to change notification settings - Fork 16
115 lines (93 loc) · 3.49 KB
/
Copy pathupdate_site.yml
File metadata and controls
115 lines (93 loc) · 3.49 KB
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
name: Update generated site
permissions:
contents: write
pages: write
id-token: write
on:
repository_dispatch: {}
workflow_dispatch:
inputs:
action:
description: 'Which action/command to run'
required: true
default: 'all'
concurrency:
group: generated-site-update
cancel-in-progress: false
jobs:
update_site:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message || '', 'skip-ci') }}
env:
ACTION: ${{ github.event.action || github.event.inputs.action }}
EXAMPLES_REF: ${{ github.event.client_payload.examples_sha || github.event.client_payload.after || github.event.client_payload.sha || 'master' }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: master
fetch-depth: 0
- name: Refresh checkout
run: |
git fetch origin master
git checkout master
git reset --hard origin/master
- name: Setup Ruby
uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5
with:
ruby-version: '3.3.5'
bundler-cache: true
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.10.5
architecture: x64
- name: Install Java
if: env.ACTION == 'examples' || env.ACTION == 'codepad' || env.ACTION == 'all'
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
with:
java-version: '25'
distribution: 'temurin'
- name: Install Python dependencies
run: python -m pip install --user requests pyyaml markdown==3.4.1 pygments==2.13.0
- name: Show action and event
run: 'echo "Event: ${{ github.event_name }} Action: ${{ env.ACTION }}"'
- if: env.ACTION == 'asset-portal'
name: Update assets
run: python update.py --download asset-portal commit
- if: env.ACTION == 'games-showcase'
name: Update games
run: python update.py --download games-showcase commit
- if: env.ACTION == 'docs'
name: Update docs
run: python update.py --download docs commit
- if: env.ACTION == 'refdoc'
name: Update refdoc
run: python update.py --download refdoc commit
- if: env.ACTION == 'examples'
name: Update examples
run: python update.py --download --examples-ref "$EXAMPLES_REF" examples commit
- if: env.ACTION == 'codepad'
name: Update codepad
run: python update.py --download codepad commit
- if: env.ACTION == 'all'
name: Update everything
run: python update.py --download all
- if: startsWith(env.ACTION, 'extension-')
name: Update extension
run: python update.py --download --extension "$ACTION" extensions refdoc commit
- name: Build Jekyll site
run: bundle exec jekyll build
- name: Install Pagefind Python
run: python -m pip install "pagefind[extended]==1.5.2"
- name: Index site with Pagefind
run: python3 -m pagefind
- if: github.ref == 'refs/heads/master'
name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9
with:
path: _site
- if: github.ref == 'refs/heads/master'
name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128