[format] [rename] #656
This file contains hidden or 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
# | |
# This GitHub Actions workflow builds and deploys the re-frame documentation website hosted on GitHub Pages at: | |
# https://day8.github.io/re-frame/ | |
# | |
# More about the build process are documented at | |
# https://github.com/day8/re-frame/blob/feature/mkdocs/docs/developer-notes.md | |
name: docs | |
on: | |
push: | |
branches: 'master' | |
jobs: | |
re-frame-docs-app: | |
name: Re-frame Docs App | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout Current Branch | |
uses: actions/checkout@v5 | |
- run: git config --global --add safe.directory /__w/re-frame/re-frame | |
- name: Maven cache | |
id: maven-cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj', '.github/workflows/**') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '24' | |
- name: Install clojure tools | |
uses: DeLaGuardo/setup-clojure@12.5 | |
with: | |
cli: 'latest' | |
bb: 'latest' | |
- run: bb release-docs | |
env: | |
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | |
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} | |
GITHUB_USERNAME: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create re-frame-docs App Artifact | |
working-directory: docs | |
run: | | |
mv api-re-frame.alpha.md js | |
mv api-re-frame.core.md js | |
tar Jcf re-frame-docs-app.tar.xz js | |
- name: Upload re-frame-docs App Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: re-frame-docs-app | |
path: docs/re-frame-docs-app.tar.xz | |
mkdocs: | |
name: MkDocs | |
needs: | |
- re-frame-docs-app | |
runs-on: ubuntu-24.04 | |
container: | |
image: "squidfunk/mkdocs-material:5.5.9" | |
steps: | |
- name: Checkout Current Branch | |
uses: actions/checkout@v4 | |
- run: git config --global --add safe.directory /__w/re-frame/re-frame | |
- name: Download re-frame-docs App Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: re-frame-docs-app | |
path: docs | |
- name: Extract re-frame-docs App Artifact | |
working-directory: docs | |
run: | | |
tar Jxf re-frame-docs-app.tar.xz | |
mv js/api-re-frame.alpha.md api-re-frame.alpha.md | |
mv js/api-re-frame.core.md api-re-frame.core.md | |
- name: Build MkDocs Documentation | |
run: mkdocs build | |
- name: Create MkDocs Artifact | |
run: tar zcf mkdocs.tar.gz site/ | |
- name: Upload MkDocs Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mkdocs | |
path: mkdocs.tar.gz | |
github-pages: | |
name: GitHub Pages | |
needs: mkdocs | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout GitHub Pages Branch | |
uses: actions/checkout@v5 | |
with: | |
ref: "gh-pages" | |
path: "gh-pages" | |
- name: Download MkDocs Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: mkdocs | |
- name: Extract MkDocs Artifact | |
run: | | |
tar zxf mkdocs.tar.gz | |
rm -rf gh-pages/* | |
cp -Rv site/* gh-pages/ | |
- name: Commit | |
working-directory: ./gh-pages | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Update docs" | |
- name: Push | |
working-directory: ./gh-pages | |
run: | | |
REMOTE="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git push "${REMOTE}" HEAD:gh-pages |