-
Notifications
You must be signed in to change notification settings - Fork 20
100 lines (85 loc) · 2.87 KB
/
deploy.yml
File metadata and controls
100 lines (85 loc) · 2.87 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
name: Deploy to GitHub Pages
on:
push:
branches: [main]
paths:
- 'content/**'
- 'translations/**'
- 'templates/**'
- 'site/**'
- 'html-generators/generateog.java'
workflow_run:
workflows: ['Build Generator JARs']
types: [completed]
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
- name: Restore cached generate JAR and AOT
id: cache-restore
uses: actions/cache/restore@v5
with:
path: |
html-generators/generate.jar
html-generators/generate.aot
key: generator-${{ hashFiles('html-generators/generate.java') }}
- name: Generate HTML with cached JAR + AOT
if: steps.cache-restore.outputs.cache-hit == 'true'
run: java -XX:AOTCache=html-generators/generate.aot -jar html-generators/generate.jar
- name: Setup JBang (cache miss)
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: jbangdev/setup-jbang@main
- name: Generate HTML with JBang (cache miss)
if: steps.cache-restore.outputs.cache-hit != 'true'
run: jbang html-generators/generate.java
- name: Restore cached generateog JAR and AOT
id: cache-restore-og
uses: actions/cache/restore@v5
with:
path: |
html-generators/generateog.jar
html-generators/generateog.aot
key: generateog-${{ hashFiles('html-generators/generateog.java') }}
- name: Generate OG cards with cached JAR + AOT
if: steps.cache-restore-og.outputs.cache-hit == 'true'
run: java -XX:AOTCache=html-generators/generateog.aot -jar html-generators/generateog.jar
- name: Generate OG cards with JBang (cache miss)
if: steps.cache-restore-og.outputs.cache-hit != 'true'
run: |
if ! command -v jbang &> /dev/null; then
echo "Installing JBang..."
curl -Ls https://sh.jbang.dev | bash -s - app setup
export PATH="$HOME/.jbang/bin:$PATH"
fi
jbang html-generators/generateog.java
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4