Skip to content

Commit 1741eab

Browse files
authored
Updates version, ci and add sitemap (#53)
1 parent f358b5d commit 1741eab

File tree

15 files changed

+154
-55
lines changed

15 files changed

+154
-55
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build PR Preview
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build-preview:
8+
name: Build Preview
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Generate blog
14+
uses: quarkiverse/quarkus-roq@v1
15+
with:
16+
github-pages: 'false'
17+
18+
- name: Store PR id
19+
run: |
20+
echo ${{ github.event.number }} > ./target/roq/pr-id.txt
21+
22+
- name: Uploading artifact
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: blog
26+
path: ./target/roq
27+
retention-days: 3

.github/workflows/static.yml

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,30 @@
1-
## Deploy to GH-Pages for your Quarkus Roq blog.
2-
name: Quarkus Roq Deploy CI
1+
## Deploy to GH-Pages for your Quarkus Roq site.
2+
name: Roq Site Deploy
33

44
on:
55
push:
6-
branches: [ master ]
6+
branches: [ master ] # Switch to the branch which should be deployed to GitHub Pages
77
workflow_dispatch:
88

9-
env:
10-
QUARKUS_ROQ_GENERATOR_BATCH: true
11-
TZ: Europe/Paris
12-
139
jobs:
1410
build:
1511
runs-on: ubuntu-latest
1612
steps:
1713
- uses: actions/checkout@v4
18-
- name: Set up JDK 21
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: 21
22-
distribution: 'temurin'
23-
cache: 'maven'
24-
- name: Get GitHub Pages URL
25-
id: get_url
26-
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
run: |
29-
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url');echo "ghp-url=$url";
30-
path=$(echo "$url" | sed -E 's|https?://[^/]+(/.*)?|\1|')
31-
url=$(echo "$url" | sed -E 's|(https?://[^/]+).*|\1|')
32-
if [ -z "$path" ]; then
33-
path="/"
34-
fi
35-
echo "SITE_URL=$url"; echo "SITE_URL=$url" >> $GITHUB_ENV;
36-
echo "SITE_PATH=$path"; echo "SITE_PATH=$path" >> $GITHUB_ENV;
37-
- name: Build & Generate Blog
38-
run: mvn -B package quarkus:run -DskipTests -Dquarkus.http.root-path=$SITE_PATH -Dsite.url=$SITE_URL
39-
- name: Upload site as artifact
40-
uses: actions/upload-artifact@v4
14+
- name: Generate Roq Site
15+
uses: quarkiverse/quarkus-roq@v1
4116
with:
42-
name: site
43-
path: target/roq
44-
retention-days: 1
17+
github-token: ${{ secrets.GITHUB_TOKEN }} # Used to automatically get the GitHub Pages url
4518
deploy:
46-
runs-on: ubuntu-latest
47-
needs: build
48-
permissions:
49-
pages: write # to deploy to Pages
50-
id-token: write # to verify the deployment originates from an appropriate source
5119
environment:
5220
name: github-pages
5321
url: ${{ steps.deployment.outputs.page_url }}
22+
permissions:
23+
pages: write # to deploy to Pages
24+
id-token: write # to verify the deployment originates from an appropriate source
25+
runs-on: ubuntu-latest
26+
needs: build
5427
steps:
55-
- name: Download Built site
56-
uses: actions/download-artifact@v4
57-
with:
58-
name: site
59-
path: _site
60-
- name: Setup Pages
61-
uses: actions/configure-pages@v5
62-
- name: Upload artifact
63-
uses: actions/upload-pages-artifact@v3
6428
- name: Deploy to GitHub Pages
6529
id: deployment
66-
uses: actions/deploy-pages@v4
30+
uses: actions/deploy-pages@v4
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Surge.sh PR Preview
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Build PR Preview" ]
6+
types:
7+
- completed
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
preview:
15+
runs-on: ubuntu-latest
16+
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
17+
permissions:
18+
pull-requests: write # Required to update PR status comment
19+
steps:
20+
- name: Download blog artifact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: blog
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
run-id: ${{ github.event.workflow_run.id }}
26+
27+
- name: Retrieve PR id
28+
id: pr
29+
run: |
30+
echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
31+
rm -f .pr-id
32+
33+
- name: Publishing blog to gh-pages
34+
id: deploy-blog
35+
run: npx surge ./ --domain https://marsjug-org-${{ steps.pr.outputs.id }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }}
36+
37+
- name: Update PR status comment on success
38+
uses: quarkusio/action-helpers@main
39+
with:
40+
action: maintain-one-comment
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
pr-number: ${{ steps.pr.outputs.id }}
43+
body: |
44+
🚀 PR Preview for marsjug.org has been successfully deployed!
45+
It's available at https://marsjug-org-${{ steps.pr.outputs.id }}-preview.surge.sh and will be removed when the PR closes.
46+
body-marker: <!-- Preview status comment marker -->
47+
48+
- name: Update PR status comment on failure
49+
uses: quarkusio/action-helpers@main
50+
if: ${{ failure() }}
51+
with:
52+
action: maintain-one-comment
53+
github-token: ${{ secrets.GITHUB_TOKEN }}
54+
pr-number: ${{ steps.pr.outputs.id }}
55+
body: |
56+
😭 Deploy PR Preview failed.
57+
body-marker: <!-- Preview status comment marker -->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Surge.sh Teardown
2+
3+
on:
4+
pull_request_target:
5+
# when using teardown: 'true', add default event types + closed event type
6+
types: [closed]
7+
8+
jobs:
9+
preview:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write # Required to update PR status comment
13+
steps:
14+
- name: Teardown Surge.sh preview (blog)
15+
id: teardown-blog
16+
run: npx surge teardown https://marsjug-org-${{ github.event.number }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} || true
17+
- name: Update PR status comment
18+
uses: quarkusio/action-helpers@main
19+
with:
20+
action: maintain-one-comment
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
pr-number: ${{ github.event.number }}
23+
body: |
24+
🙈 The PR is closed and the preview is expired.
25+
body-marker: <!-- Preview status comment marker -->

content/partenaires.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
{#for partenaire in cdi:partenaires.list}
99
<div class="span4">
1010
<h3>{partenaire.name}</h3>
11-
<p><a href="{partenaire.url}" target="_blank"><img src="{site.image('partenaires').resolve(partenaire.image)}"/></a></p>
11+
<p><a href="{partenaire.url}" target="_blank"><img src="{site.image(str:fmt("partenaires/%s", partenaire.image))}"/></a></p>
1212
</div>
1313
{/}

content/reunions/2025/2025-02-04-clement.md renamed to content/reunions/2025/2025-02-04-clement/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ speakers:
66
inscription: https://www.meetup.com/marseille-java-user-group-meetup/events/305735018/
77
location: tricentis
88
date: 2025-02-04 19:00:00 +0100
9-
image: static/assets/images/marioTuyau.jpg
9+
image: marioTuyau.jpg
1010
---
1111
Le développement logiciel est souvent un challenge, d'autant plus quand on a de
1212
fortes contraintes matérielles : peu de CPU, peu de RAM, peu voire pas de

content/reunions/2025/2025-03-05-scraly.md renamed to content/reunions/2025/2025-03-05-scraly/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ speakers:
66
inscription: https://www.meetup.com/marseille-java-user-group-meetup/events/306140214
77
location: tricentis
88
date: 2025-03-05 19:00:00 +0100
9-
image: "/static/assets/images/understandingk8s.jpg"
9+
image: "understandingk8s.jpg"
1010
---
1111
Kubernetes est devenu le standard de facto pour déployer et exploiter des applications conteneurisées. Mais comprendre Kubernetes peut s’avérer difficile ou prendre beaucoup de temps.
1212

content/sitemap.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{#include fm/sitemap.xml}

pom.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1313
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
1414
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
15-
<quarkus.platform.version>3.16.2</quarkus.platform.version>
15+
<quarkus.platform.version>3.18.3</quarkus.platform.version>
1616
<skipITs>true</skipITs>
1717
<surefire-plugin.version>3.5.0</surefire-plugin.version>
18+
<quarkus-roq.version>1.3.0.Alpha2</quarkus-roq.version>
1819
</properties>
1920

2021
<dependencyManagement>
@@ -33,7 +34,12 @@
3334
<dependency>
3435
<groupId>io.quarkiverse.roq</groupId>
3536
<artifactId>quarkus-roq</artifactId>
36-
<version>1.0.3</version>
37+
<version>${quarkus-roq.version}</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>io.quarkiverse.roq</groupId>
41+
<artifactId>quarkus-roq-plugin-sitemap</artifactId>
42+
<version>${quarkus-roq.version}</version>
3743
</dependency>
3844
<dependency>
3945
<groupId>io.quarkus</groupId>
@@ -54,6 +60,12 @@
5460
<artifactId>quarkus-junit5</artifactId>
5561
<scope>test</scope>
5662
</dependency>
63+
<dependency>
64+
<groupId>io.quarkiverse.roq</groupId>
65+
<artifactId>quarkus-roq-testing</artifactId>
66+
<version>${quarkus-roq.version}</version>
67+
<scope>test</scope>
68+
</dependency>
5769
</dependencies>
5870

5971
<build>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
site.collections.reunions=true
22
site.collections.reunions.future=true
3-
quarkus.log.category."io.quarkiverse.roq.frontmatter.deployment.scan".level=DEBUG
3+
quarkus.log.category."io.quarkiverse.roq.frontmatter.deployment.scan".level=DEBUG
4+
site.slugify-files=false

src/test/java/SiteTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import io.quarkiverse.roq.testing.RoqAndRoll;
2+
import io.quarkus.test.junit.QuarkusTest;
3+
import org.junit.jupiter.api.Test;
4+
5+
@QuarkusTest
6+
@RoqAndRoll
7+
public class SiteTest {
8+
9+
@Test
10+
public void test() {
11+
// This will test all pages
12+
}
13+
}

templates/layouts/default.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
{#seo page site /}
77
{#rss site /}
88

9-
<base href="{site.url.root.relative}">
109
<meta http-equiv="X-UA-Compatible" content="IE=edge">
1110
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
1211
<link rel="shortcut icon" href="{site.imagesDirUrl.resolve('favicon.ico')}" type="image/x-icon">

0 commit comments

Comments
 (0)