Skip to content

Commit

Permalink
Fix doc gh action (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy authored Nov 2, 2024
1 parent c3199b6 commit ff79858
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions docs/modules/ROOT/pages/includes/github-pages.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[[github-pages]]
== Deploy to GitHub Pages

Here is an example workflow file to deploy to GitHub Pages:
To create your GitHub Page with Roq:

..github/workflows/deploy-gh-pages.yml
1. *Open* your GitHub repository page
2. **Go to** Settings->Page
3. *Pick:* `Source: GitHub Actions`
4. *Click* on Static Html "Configure" button
5. Paste this content (to adapt with Gradle):

..github/workflows/static.yml
[source,yaml]
----
## Deploy to GH-Pages for your Quarkus Roq blog.
Expand All @@ -14,6 +20,9 @@ on:
branches: [ main ]
workflow_dispatch:
env:
QUARKUS_ROQ_GENERATOR_BATCH: true
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,8 +34,21 @@ jobs:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Get GitHub Pages URL
id: get_url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url');echo "ghp-url=$url";
path=$(echo "$url" | sed -E 's|https?://[^/]+(/.*)?|\1|')
url=$(echo "$url" | sed -E 's|(https?://[^/]+).*|\1|')
if [ -z "$path" ]; then
path="/"
fi
echo "SITE_URL=$url"; echo "SITE_URL=$url" >> $GITHUB_ENV;
echo "SITE_PATH=$path"; echo "SITE_PATH=$path" >> $GITHUB_ENV;
- name: Build & Generate Blog
run: QUARKUS_ROQ_GENERATOR_BATCH=true mvn -B package quarkus:run -DskipTests
run: mvn -B package quarkus:run -DskipTests -Dquarkus.http.root-path=$SITE_PATH -Dsite.url=$SITE_URL
- name: Upload site as artifact
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit ff79858

Please sign in to comment.