Add gradle wrapper jar explicitly. #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Deploy Web Apps to GitHub Pages | |
| on: | |
| push: | |
| tags: | |
| - '*' # Push events to matching *, i.e. 1.0, 20.15.10 | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "22" | |
| - name: Make gradlew executable (if present) | |
| run: | | |
| if [ -f "./gradlew" ]; then | |
| chmod +x ./gradlew | |
| fi | |
| - name: Build all web apps (per subproject) | |
| run: | | |
| set -e | |
| # Optional: ensure jq exists (Ubuntu images usually have it already) | |
| if ! command -v jq >/dev/null 2>&1; then | |
| sudo apt-get update | |
| sudo apt-get install -y jq | |
| fi | |
| # Find all webapp.json files | |
| while IFS= read -r meta; do | |
| app_dir="$(dirname "$meta")" | |
| build_cmd="$(jq -r '.build.command // empty' "$meta")" | |
| if [ -z "$build_cmd" ]; then | |
| echo "[INFO] $meta has no build.command, skipping build step." | |
| continue | |
| fi | |
| echo "[INFO] Building app in $app_dir with: $build_cmd" | |
| ( | |
| cd "$app_dir" | |
| # Execute the command as defined in webapp.json | |
| set -e | |
| eval "$build_cmd" | |
| ) | |
| done < <(find . -name webapp.json -print) | |
| - name: Prepare static site folder (scan apps & generate index) | |
| run: | | |
| set -e | |
| python3 scripts/generate-samples-page.py --build --output site | |
| - name: Upload artifact for GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| 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 |