Skip to content

[ci] Better caching via a new cache key in publish-ghpages #117

[ci] Better caching via a new cache key in publish-ghpages

[ci] Better caching via a new cache key in publish-ghpages #117

Workflow file for this run

name: publish-ghpages
on:
push:
branches:
- main
- ci
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Sbt packages with different key
uses: actions/cache@v4
with:
path: |
**/*.sbt
**/project/build.properties
**/project/**.scala
**/project/**.sbt
key: sbt-site-${{ hashFiles('**/*.sbt,**/project/build.properties,**/project/**.scala,**/project/**.sbt') }}
restore-keys: |
sbt-site-
setup-java-Linux-sbt-${{ hashFiles('**/*.sbt,**/project/build.properties,**/project/**.scala,**/project/**.sbt') }}
setup-java-Linux-sbt-
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build site
run: sbt webStage
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './target/web/stage'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4