Skip to content

Commit

Permalink
docs: use mise tasks for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 18, 2024
1 parent b362794 commit c0b60c8
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ jobs:
- uses: jdx/mise-action@v2
with:
install_args: bun
working_directory: docs
- run: bun install
working-directory: docs
- run: bun run docs:build
working-directory: docs
cache: false
- run: mise run docs:build
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: mise run release-docs
working-directory: docs
run: mise run docs:release
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
4 changes: 2 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ export default defineConfig({
[
"script",
{
data: { goatcounter: "https://jdx.goatcounter.com/count" },
async: true,
"data-goatcounter": "https://jdx.goatcounter.com/count",
async: "",
src: "//gc.zgo.at/count.js",
},
],
Expand Down
22 changes: 18 additions & 4 deletions tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,26 @@ run a command inside of development docker container

## `docs`

- Depends: docs:setup

- **Usage**: `docs`

## `docs:build`

- Depends: docs:setup

- **Usage**: `docs:build`

## `docs:release`

- Depends: docs:build

- **Usage**: `docs:release`

## `docs:setup`

- **Usage**: `docs:setup`

## `filetask`

- **Usage**: `filetask [-f --force] [-u --user <user>] <file> <arg_with_default>`
Expand Down Expand Up @@ -141,10 +159,6 @@ User to run as

- **Usage**: `release`

## `release-docs`

- **Usage**: `release-docs`

## `release-plz`

- **Usage**: `release-plz`
Expand Down
12 changes: 11 additions & 1 deletion tasks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ run = "cargo build --all-features"
#outputs = ["target/debug/mise"]

[docs]
depends = ["docs:setup"]
dir = "docs"
run = "npm run docs:dev"
run = "bun run docs:dev"

["docs:setup"]
dir = "docs"
run = "bun i"

["docs:build"]
depends = ["docs:setup"]
dir = "docs"
run = "bun run docs:build"

["render:usage"]
depends = ["build"]
Expand Down
3 changes: 1 addition & 2 deletions tasks/release-docs → tasks/docs/release
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env bash
set -xeuo pipefail
#MISE depends=["docs:build"]
#MISE dir="docs"

export AWS_REGION=auto
export AWS_ENDPOINT_URL=https://6e243906ff257b965bcae8025c2fc344.r2.cloudflarestorage.com

bun run docs:build

if [ $((RANDOM % 30)) -eq 0 ]; then
# delete old assets only roughly 1/30 times
# deleting old assets can break the site for people currently on it
Expand Down

0 comments on commit c0b60c8

Please sign in to comment.