-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f4c336
commit c8c5e5c
Showing
2 changed files
with
61 additions
and
0 deletions.
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,45 @@ | ||
name: Deploy when pushing on main | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
name: "Deploy site" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v2 | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Build site | ||
run: bun run build | ||
|
||
- name: Upload files | ||
uses: djang0dev/[email protected] | ||
with: | ||
upload: true | ||
remove: true | ||
storageName: ${{ secrets.BUNNY_STORAGE_NAME }} | ||
storagePassword: ${{ secrets.BUNNY_STORAGE_PASSWORD }} | ||
destination: "tibs.gay/" | ||
sourcePattern: "./dist/**/*.*" | ||
apiKey: ${{ secrets.BUNNY_API_KEY }} | ||
purgePullZone: true | ||
pullZoneId: ${{ secrets.BUNNY_PULL_ZONE_ID }} | ||
|
||
- name: Deploy script | ||
uses: BunnyWay/actions/deploy-script@main | ||
with: | ||
script_id: ${{ secrets.BUNNY_SCRIPT_ID }} | ||
deploy_key: ${{ secrets.BUNNY_DEPLOY_KEY }} | ||
file: "script.ts" |
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,16 @@ | ||
import * as BunnySDK from "https://esm.sh/@bunny.net/[email protected]"; | ||
|
||
BunnySDK.net.http.serve(async (request: Request): Response | Promise<Response> => { | ||
const url = new URL(request.url); | ||
let path = url.pathname; | ||
|
||
if (path == "/") { | ||
path = "/index.html"; | ||
} | ||
|
||
if (path.startsWith("/_astro") || path == "/index.html") { | ||
return fetch("https://tibs-sites.b-cdn.net/tibs.gay" + path); | ||
} | ||
|
||
return Response.redirect("/", 308); | ||
}); |