Move the site to bnnuy

This commit is contained in:
Val Packett 2024-11-13 16:34:33 -03:00
parent 9693281cb4
commit 1541ba5589
3 changed files with 45 additions and 25 deletions

View file

@ -1,9 +1,39 @@
when:
- event: push
steps:
test:
image: denoland/deno:alpine-1.45.4
- name: test
image: denoland/deno:alpine
pull: true
commands:
- deno test
- DENO_FUTURE=1 deno test
- echo uwu | DENO_FUTURE=1 deno run server/hash-admin-password.ts
- deno fmt --check
- DENO_FUTURE=1 deno run --allow-env --allow-read --allow-write=output npm:tiddlywiki@5.3.5 --build
- deno test server
- echo uwu | deno run server/hash-admin-password.ts
- name: fmt
image: denoland/deno:alpine
commands:
- deno fmt --check --ignore="**/*.css" plugins server
- name: fetch_theme
image: alpine/curl
when:
- event: push
branch: release
commands:
- mkdir notebook
- curl -L https://github.com/valpackett/Notebook/archive/e2c61ccd6e9db5cfcbc77e54eccc8b5961da5831.tar.gz | tar -xvzf - -C notebook --strip-components=1
- name: build
image: denoland/deno:alpine
environment:
TIDDLYWIKI_THEME_PATH: notebook/themes
TIDDLYWIKI_PLUGIN_PATH: notebook/plugins
commands:
- deno run --allow-env --allow-read --allow-write=output npm:tiddlywiki@5.3.5 --build
- name: push
image: alpine/curl
when:
- event: push
branch: release
secrets:
- BUNNY_BUCKET
- BUNNY_KEY
commands:
- sh bunny.sh

8
bunny.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
cd output
find * -type f -exec curl --fail --request PUT \
--url https://storage.bunnycdn.com/$BUNNY_BUCKET/{} \
--header "AccessKey: $BUNNY_KEY" \
--header "Content-Type: application/octet-stream" \
--data-binary @{} \;

View file

@ -1,18 +0,0 @@
[build]
publish = "output"
command = """
mkdir notebook; curl -L https://github.com/valpackett/Notebook/archive/e2c61ccd6e9db5cfcbc77e54eccc8b5961da5831.tar.gz | tar -xvzf - -C notebook --strip-components=1 &&
TIDDLYWIKI_THEME_PATH=notebook/themes TIDDLYWIKI_PLUGIN_PATH=notebook/plugins npx tiddlywiki@5.3.5 --build
"""
[[headers]]
for = "/*"
[headers.values]
x-content-type-options = "nosniff"
x-frame-options = "SAMEORIGIN"
referrer-policy = "no-referrer-when-downgrade"
[[redirects]]
from = "/w/:name/:file"
to = "/app/:file"
status = 200