-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One action publishes the 'prerelease' version on every push to `main`. The other publishes a 'latest' version on every releasse. I tested both of them, but not with branch protection rules.
- Loading branch information
1 parent
8f29afa
commit c8bb8fb
Showing
4 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# Set up a virtual environment with the required tools, build, and deploy the docs. | ||
# | ||
# Run from the root directory of the project as | ||
# .github/scripts/docs-build-deploy 'https://martinvonz.github.io' prerelease main | ||
# All arguments after the first are passed to `mike deploy`, run | ||
# `poetry run -- mike deploy --help` for options. Note that `mike deploy` | ||
# creates a commit directly on the `gh-pages` branch. | ||
set -ev | ||
|
||
export "SITE_URL_FOR_MKDOCS=$1"; shift | ||
# https://github.com/python-poetry/poetry/issues/1917 | ||
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring | ||
poetry install # Only really needed once per environment unless there are updates | ||
poetry run -- mike deploy "$@" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: website | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
prerelease-docs-build-deploy: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: "git fetch origin gh-pages --depth=1" | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: latest | ||
- name: Install dependencies, compile and deploy docs | ||
run: | | ||
git config user.name jj-docs-bot | ||
git config user.email [email protected] | ||
.github/scripts/docs-build-deploy 'https://martinvonz.github.io/jj' prerelease main --push | ||
- name: "Show `git diff --stat`" | ||
run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,31 @@ jobs: | |
asset_path: ${{ env.ASSET }} | ||
asset_name: ${{ env.ASSET }} | ||
asset_content_type: application/octet-stream | ||
|
||
docs-build-deploy: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: "git fetch origin gh-pages --depth=1" | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: latest | ||
- name: Install dependencies, compile and deploy docs | ||
run: | | ||
git config user.name jj-docs-bot | ||
git config user.email [email protected] | ||
# Using the 'latest' tag below makes the website default | ||
# to this version. | ||
.github/scripts/docs-build-deploy 'https://martinvonz.github.io/jj' "${{ github.event.release.tag_name }}" latest --update-aliases --push | ||
- name: "Show `git diff --stat`" | ||
run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)" |
This file contains 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