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

Keep older versions of the site #32

Open
wants to merge 1 commit into
base: scala3
Choose a base branch
from
Open
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
33 changes: 29 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v12
- name: Generate site
run: sbt "site/doc"
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: target/site-output
- name: Deploy new site
run: |
echo "Setting up git"
git config user.name "gaction"
git config user.email "[email protected]"
git remote set-url origin https://gaction:${GITHUB_TOKEN}@github.com/vincenzobaz/library-example.git
git checkout gh-pages

echo "Adding new site files"
tag="$(basename ${{ github.ref }})"
mv target/site-output versions/$tag
git add versions/$tag
git commit -m "[action] adding versions $tag"

echo "Preparing new sites.json"
cat sites.json | jq --arg newver $tag '.versions[$newver] = "https://vincenzobaz.github.io/library-example/versions\($newver)"' > newsites.json
echo "OLD"
cat sites.json
echo "NEW"
cat newsites.json
rm sites.json
mv newsites.json sites.json

echo "Pushing new sites.json"
git add sites.json
git commit -m "[action] add new version sites.json"
git push origin gh-pages
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ lazy val publishSettings = Def.settings(
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
// publish to the Sonatype repository
publishTo := sonatypePublishToBundle.value,
Compile / doc / target := file("site-output"),
// binary compatibility check
mimaPreviousArtifacts := Set.empty // Disabled on `master` branch
)
Expand Down Expand Up @@ -62,4 +61,3 @@ lazy val siteSettings = {
)
)
}