| 1 |
name: website |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
|
| 8 |
permissions: {} |
| 9 |
|
| 10 |
jobs: |
| 11 |
prerelease-docs-build-deploy: |
| 12 |
# IMPORTANT: this workflow also functions as a test for `docs-deploy-website-latest-release` in |
| 13 |
# releases.yml. Any fixes here should probably be duplicated there. |
| 14 |
permissions: |
| 15 |
contents: write |
| 16 |
if: github.repository_owner == 'jj-vcs' # Stops this job from running on forks |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
os: [ubuntu-24.04] |
| 20 |
runs-on: ${{ matrix.os }} |
| 21 |
|
| 22 |
steps: |
| 23 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 24 |
with: |
| 25 |
# `.github/scripts/docs-build-deploy` will need to `git push` to the docs branch |
| 26 |
persist-credentials: true |
| 27 |
- run: "git fetch origin gh-pages --depth=1" |
| 28 |
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 |
| 29 |
with: |
| 30 |
python-version: 3.11 |
| 31 |
- name: Install uv |
| 32 |
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 |
| 33 |
with: |
| 34 |
version: "0.5.1" |
| 35 |
- name: Install dependencies, compile and deploy docs |
| 36 |
run: | |
| 37 |
git config user.name 'jj-docs[bot]' |
| 38 |
git config user.email 'jj-docs[bot]@users.noreply.github.io' |
| 39 |
export MKDOCS_SITE_NAME="Jujutsu docs (prerelease)" |
| 40 |
export MKDOCS_PRIMARY_COLOR="blue grey" |
| 41 |
.github/scripts/docs-build-deploy prerelease --push |
| 42 |
- name: "Show `git diff --stat`" |
| 43 |
run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)" |
| 44 |
|
| 45 |
starlight-docs-build-deploy: |
| 46 |
# Deploy Starlight-based docs to /starlight for comparison with MkDocs version |
| 47 |
needs: prerelease-docs-build-deploy |
| 48 |
permissions: |
| 49 |
contents: write |
| 50 |
if: github.repository_owner == 'jj-vcs' # Stops this job from running on forks |
| 51 |
runs-on: ubuntu-24.04 |
| 52 |
|
| 53 |
steps: |
| 54 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 55 |
with: |
| 56 |
persist-credentials: true |
| 57 |
- run: "git fetch origin gh-pages --depth=1" |
| 58 |
- name: Setup Node.js |
| 59 |
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 |
| 60 |
with: |
| 61 |
node-version: '22' |
| 62 |
- name: Install dependencies |
| 63 |
working-directory: web/docs |
| 64 |
run: npm ci |
| 65 |
- name: Build Starlight docs |
| 66 |
working-directory: web/docs |
| 67 |
run: npm run build -- --base /starlight/ |
| 68 |
- name: Deploy to gh-pages/starlight |
| 69 |
run: | |
| 70 |
git config user.name 'jj-docs[bot]' |
| 71 |
git config user.email 'jj-docs[bot]@users.noreply.github.io' |
| 72 |
git checkout gh-pages |
| 73 |
rm -rf starlight |
| 74 |
mv web/docs/dist starlight |
| 75 |
git add starlight |
| 76 |
git commit -m "Deploy Starlight docs to /starlight" || echo "No changes to commit" |
| 77 |
git push origin gh-pages |