Deploy site to gh-pages #690
Workflow file for this run
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
name: CI | |
on: | |
workflow_dispatch: | |
inputs: | |
make_snapshot_release: | |
description: "Publish libraries's SNAPSHOT" | |
default: false | |
type: boolean | |
required: false | |
force_deploy_ghpages: | |
description: "Force deploy gb-pages" | |
default: false | |
type: boolean | |
required: false | |
pull_request: | |
branches-ignore: | |
- "gh-pages" | |
push: | |
branches: [master, main] | |
tags: ["v*"] | |
jobs: | |
build-test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/japgolly/setup-everything-scala | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work | |
- name: Setup Java and Scala | |
uses: olafurpg/setup-scala@v14 | |
with: | |
java-version: [email protected] | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" # or whatever | |
- name: Setup Scala.JS | |
uses: japgolly/setup-scalajs@v1 | |
- name: Cache sbt | |
uses: coursier/[email protected] | |
### Compile and TESTS ### | |
- name: sbt "ciJob" | |
run: sbt -mem 2048 -J-Xmx5120m "ciJob" | |
env: | |
NODE_OPTIONS: "--openssl-legacy-provider" # This is need after node-version "16" | |
ghpages: | |
name: Deploy gh-pages | |
needs: build-test | |
runs-on: ubuntu-latest | |
if: (inputs.force_deploy_ghpages == true) || (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v') | |
steps: | |
# https://github.com/japgolly/setup-everything-scala | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work | |
- name: Setup Java and Scala | |
uses: olafurpg/setup-scala@v14 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" # or whatever | |
- name: Setup Scala.JS | |
uses: japgolly/setup-scalajs@v1 | |
- name: Cache sbt | |
uses: coursier/[email protected] | |
### create build deploy gh-pages ### | |
- name: sbt "docAll; siteAll" | |
run: sbt -mem 2048-J-Xmx5120m "docAll; siteAll" | |
- name: build | |
run: | | |
mkdir ./public | |
cp -r docs/target/site/did-doc/. ./public | |
cp -r docs/target/scaladoc/unidoc ./public/api | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
publish: | |
name: Publish Artifacts | |
needs: build-test | |
runs-on: ubuntu-latest | |
if: ((inputs.make_snapshot_release == true) && (github.ref_name == 'master') || startsWith(github.ref, 'refs/tags/v')) | |
steps: | |
# https://github.com/japgolly/setup-everything-scala | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work | |
- name: Setup Java and Scala | |
uses: olafurpg/setup-scala@v14 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" # or whatever | |
- name: Setup Scala.JS | |
uses: japgolly/setup-scalajs@v1 | |
- name: Cache sbt | |
uses: coursier/[email protected] | |
### Publish Artifacts ### | |
- name: publish | |
run: sbt ci-release | |
env: | |
NODE_OPTIONS: "--openssl-legacy-provider" # This is need after node-version "16" | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
PACKAGES_GITHUB_TOKEN: ${{ secrets.PACKAGES_GITHUB_TOKEN }} |