-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task #142 - Add document site using sbt-microsites
* Added: GitHub Actions to publish microsite to GitHub Pages
- Loading branch information
Showing
1 changed file
with
47 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,47 @@ | ||
name: Publish GitHub Pages | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- publish-docs | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Cache Coursier | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/coursier | ||
key: ${{ runner.os }}-coursier-scala-2_13-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-coursier-scala-2_13- | ||
- name: Cache Ivy | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.ivy2/cache | ||
key: ${{ runner.os }}-ivy-scala-2_13-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-ivy-scala-2_13- | ||
- name: publish GitHub Pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_AUTH_TOKEN }} | ||
run: | | ||
docker run \ | ||
-e GITHUB_TOKEN=$GITHUB_TOKEN \ | ||
-v ${{ github.workspace }}:/app \ | ||
-v ~/.cache/coursier:/root/.cache/coursier:z \ | ||
-v ~/.ivy2/cache:/root/.ivy2/cache:z \ | ||
k3vin/sbt-java8-jekyll:latest /bin/bash -c "cd /app && sbt 'project docs' clean publishMicrosite" | ||
- name: correct dir permission | ||
run: | | ||
sudo chown -R $(whoami):docker ~/.ivy2 | ||
sudo chown -R $(whoami):docker ~/.cache | ||
sudo chown -R $(whoami):docker ${{ github.workspace }} |