name: website on: push: branches: - main permissions: {} jobs: prerelease-docs-build-deploy: # IMPORTANT: this workflow also functions as a test for `docs-deploy-website-latest-release` in # releases.yml. Any fixes here should probably be duplicated there. permissions: contents: write if: github.repository_owner == 'jj-vcs' # Stops this job from running on forks strategy: matrix: os: [ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: # `.github/scripts/docs-build-deploy` will need to `git push` to the docs branch persist-credentials: true - run: "git fetch origin gh-pages --depth=1" - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: 3.11 - name: Install uv uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 with: version: "0.5.1" - name: Install dependencies, compile and deploy docs run: | git config user.name 'jj-docs[bot]' git config user.email 'jj-docs[bot]@users.noreply.github.io' export MKDOCS_SITE_NAME="Jujutsu docs (prerelease)" export MKDOCS_PRIMARY_COLOR="blue grey" .github/scripts/docs-build-deploy prerelease --push - name: "Show `git diff --stat`" run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)" starlight-docs-build-deploy: # Deploy Starlight-based docs to /starlight for comparison with MkDocs version needs: prerelease-docs-build-deploy permissions: contents: write if: github.repository_owner == 'jj-vcs' # Stops this job from running on forks runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: persist-credentials: true - run: "git fetch origin gh-pages --depth=1" - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with: node-version: '22' - name: Install dependencies working-directory: web/docs run: npm ci - name: Build Starlight docs working-directory: web/docs run: npm run build -- --base /starlight/ - name: Deploy to gh-pages/starlight run: | git config user.name 'jj-docs[bot]' git config user.email 'jj-docs[bot]@users.noreply.github.io' git checkout gh-pages rm -rf starlight mv web/docs/dist starlight git add starlight git commit -m "Deploy Starlight docs to /starlight" || echo "No changes to commit" git push origin gh-pages