Skip to content

Commit 309899c

Browse files
committed
Add website build check to CI workflow
ENHANCEMENT: Add website build verification to PR builds to catch template syntax errors before they get merged. CHANGES: - Added path filter to detect website changes in PRs - Added JDK 21 setup for website builds (conditional on website changes) - Added website build step that runs the same command as the deploy workflow - Only runs when website/** files are modified to avoid unnecessary builds BENEFITS: - Prevents Qute template syntax errors from breaking the main branch - Catches website build issues early in the development process - Uses the same build command as production deployment for consistency - Optimized to only run when website files actually change This will help prevent issues like the recent Qute template syntax errors that broke the website build after being merged to main.
1 parent 1bb026b commit 309899c

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ jobs:
5353
# Test that wrapper works with current version
5454
./mvx version
5555
56+
- name: Check for website changes
57+
uses: dorny/paths-filter@v3
58+
id: website-changes
59+
with:
60+
filters: |
61+
website:
62+
- 'website/**'
63+
64+
- name: Set up JDK 21 for website
65+
if: steps.website-changes.outputs.website == 'true'
66+
uses: actions/setup-java@v4
67+
with:
68+
java-version: '21'
69+
distribution: 'temurin'
70+
cache: maven
71+
72+
- name: Check website build
73+
if: steps.website-changes.outputs.website == 'true'
74+
run: |
75+
OWNER=$(echo "$GITHUB_REPOSITORY" | cut -d '/' -f 1)
76+
REPO=$(echo "$GITHUB_REPOSITORY" | cut -d '/' -f 2)
77+
SITE_URL="https://${OWNER}.github.io"
78+
SITE_PATH="/${REPO}/"
79+
echo "SITE_URL=$SITE_URL" >> $GITHUB_ENV
80+
echo "SITE_PATH=$SITE_PATH" >> $GITHUB_ENV
81+
echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY SITE_DIR=$SITE_DIR SITE_URL=$SITE_URL SITE_PATH=$SITE_PATH"
82+
# Build website to catch template syntax errors
83+
cd website
84+
QUARKUS_ROQ_GENERATOR_BATCH=true mvn clean package quarkus:run -DskipTests --no-transfer-progress \
85+
-Dquarkus.http.root-path=$SITE_PATH \
86+
-Dsite.url=$SITE_URL
87+
5688
- name: Upload build artifacts
5789
uses: actions/upload-artifact@v4
5890
with:

website/content/shell-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ mvx shell 'cp file1.txt file2.txt'
8787

8888
1. **Environment Setup**: Automatically sets up PATH and environment variables for all configured tools
8989
2. **Cross-platform**: Uses mvx-shell interpreter for consistent behavior across platforms
90-
3. **Variable Expansion**: Supports `$VAR` and `${VAR}` syntax for environment variables
90+
3. **Variable Expansion**: Supports `$VAR` and `$\{VAR\}` syntax for environment variables
9191
4. **Built-in Commands**: Includes cross-platform implementations of common commands (cd, echo, mkdir, rm, cp)
9292
5. **Tool Integration**: All mvx-managed tools are available in the PATH
9393

0 commit comments

Comments
 (0)