-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): drop GitHub Pages (#24)
- Loading branch information
1 parent
6b1bcff
commit 38fe14b
Showing
15 changed files
with
402 additions
and
3 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
.DS_Store | ||
/lib | ||
/ci | ||
.env |
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,5 @@ | ||
SRV_HOST="" | ||
SRV_USER="" | ||
SRV_PASS="" | ||
SRV_PORT= | ||
APP_PORT= |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/build | ||
/.docusaurus | ||
/.cache-loader | ||
/.svps |
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
|
||
# Production | ||
/build | ||
/.svps | ||
.env | ||
|
||
# Generated files | ||
.docusaurus | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/build | ||
/.docusaurus | ||
/.cache-loader | ||
# /**/*.mdx | ||
/.svps |
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,8 @@ | ||
FROM oven/bun:alpine | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY ./build ./build | ||
COPY ./server.ts ./server.ts | ||
|
||
CMD ["bun", "server.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,13 @@ | ||
import 'dotenv/config'; | ||
import { SVPS } from 'svps'; | ||
|
||
const { SRV_HOST, SRV_PORT, SRV_USER, SRV_PASS } = process.env; | ||
|
||
export const svps = new SVPS({ | ||
access: { | ||
host: String(SRV_HOST), | ||
port: Number(SRV_PORT), | ||
username: String(SRV_USER), | ||
password: String(SRV_PASS), | ||
}, | ||
}); |
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,27 @@ | ||
import 'dotenv/config'; | ||
import { exit } from 'poku'; | ||
import { svps } from './access.js'; | ||
|
||
(async () => { | ||
const mounted = await svps.mount({ | ||
repair: true, | ||
apt: true, | ||
apache: true, | ||
docker: true, | ||
firewall: true, | ||
}); | ||
|
||
const createdVH = | ||
mounted && | ||
(await svps.createVirtualHosts([ | ||
{ | ||
domain: 'poku.dev', | ||
port: Number(process.env.APP_PORT), | ||
www: true, | ||
}, | ||
])); | ||
|
||
await svps.end(); | ||
|
||
exit(createdVH ? 0 : 1); | ||
})(); |
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 @@ | ||
import 'dotenv/config'; | ||
import { svps } from './access.js'; | ||
import { exit } from 'poku'; | ||
|
||
(async () => { | ||
const port = process.env.APP_PORT; | ||
|
||
const uploaded = await svps.upload([ | ||
{ | ||
local: './server.ts', | ||
remote: 'server.ts', | ||
}, | ||
{ | ||
local: './build', | ||
remote: './', | ||
}, | ||
{ | ||
local: './Dockerfile', | ||
remote: 'Dockerfile', | ||
}, | ||
{ | ||
local: './docker-compose.yml', | ||
remote: 'docker-compose.yml', | ||
}, | ||
]); | ||
|
||
const composed = | ||
uploaded && | ||
(await svps.commands([`APP_PORT=${port} docker compose up --build -d`])); | ||
|
||
await svps.end(); | ||
|
||
exit(composed ? 0 : 1); | ||
})(); |
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,10 @@ | ||
version: '3.9' | ||
services: | ||
server: | ||
build: . | ||
container_name: poku-website | ||
restart: always | ||
ports: | ||
- '127.0.0.1:${APP_PORT}:${APP_PORT}' | ||
environment: | ||
APP_PORT: ${APP_PORT} |
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
Oops, something went wrong.