Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh microsite workflow #4123

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions .github/workflows/microsite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,35 @@ on:
push:
branches: [docs]

env:
JABBA_INDEX: 'https://github.com/typelevel/jdk-index/raw/main/index.json'

jobs:
build:
name: Generate Microsite
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
cache: sbt

- name: Install NodeJS 14
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/project/build.properties') }}

- name: Cache yarn
uses: actions/cache@v2
- name: Install Node.js
uses: actions/setup-node@v4
with:
path: |
website/yarn.lock
**/node_modules
key: ${{ runner.os }}-yarn-cache-v2-${{ hashFiles('website/package.json') }}
cache: 'npm'
cache-dependency-path: 'website/package-lock.json'

- name: Build
run: ./build.sh

- name: Publish
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build/cats-effect
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rm -f website/versions.json
rm -rf website/versioned_{docs,sidebars}
mkdir website/versioned_{docs,sidebars}

(cd website && yarn install)
(cd website && npm install)

# Generate scaladoc and mdoc from each submodule
(cd versions/2.x && sbt coreJVM/doc docs/mdoc)
Expand All @@ -27,19 +27,19 @@ cp -R versions/2.x/core/jvm/target/scala-2.13/api/* website/static/api/2.x/

cp -R versions/2.x/site-docs/target/mdoc/* docs/
cp versions/2.x/site-docs/sidebars.json website/sidebars.json
(cd website && yarn run version 2.x)
(cd website && npm run version 2.x)

mkdir -p website/static/api/3.x/
rm -rf website/static/api/3.x/*
cp -R versions/3.x/target/scala-2.13/unidoc/* website/static/api/3.x/

cp -R versions/3.x/site-docs/target/mdoc/* docs/
cp versions/3.x/site-docs/sidebars.json website/sidebars.json
(cd website && yarn run version 3.x)
(cd website && npm run version 3.x)

cd website
if [[ "$cmd" == "host" ]]; then
exec yarn start
exec npm run start
else
exec yarn build
exec npm run build
fi
1 change: 0 additions & 1 deletion website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
build
yarn.lock
sidebars.json
versions.json
versioned_docs
Expand Down
Loading