-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50342de
commit d4653e2
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# export-and-deploy-site.yml | ||
|
||
name: Deploy Kobweb site to Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
export: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
KOBWEB_CLI_VERSION: 0.9.16 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Query Browser Cache ID | ||
id: browser-cache-id | ||
run: echo "value=$(./gradlew -q :site:kobwebBrowserCacheId)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache Browser Dependencies | ||
uses: actions/cache@v4 | ||
id: playwright-cache | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ steps.browser-cache-id.outputs.value }} | ||
|
||
- name: Fetch kobweb | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: "varabyte/kobweb-cli" | ||
tag: "v${{ env.KOBWEB_CLI_VERSION }}" | ||
fileName: "kobweb-${{ env.KOBWEB_CLI_VERSION }}.zip" | ||
tarBall: false | ||
zipBall: false | ||
|
||
- name: Unzip kobweb | ||
run: unzip kobweb-${{ env.KOBWEB_CLI_VERSION }}.zip | ||
|
||
- name: Run export | ||
run: | | ||
cd site | ||
../kobweb-${{ env.KOBWEB_CLI_VERSION }}/bin/kobweb export --notty --layout static | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./site/.kobweb/site | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: export | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |