deploy domain redirect to fly

This commit is contained in:
MapleLeaf
2022-01-15 13:56:15 -06:00
parent 0edf702b5f
commit c86648f44e
4 changed files with 19 additions and 17 deletions

View File

@@ -1,17 +0,0 @@
name: deploy website
on:
push:
branches: [main]
paths:
- "packages/website/**"
- "reacord/library/**/*.{ts,tsx}"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
with:
args: "deploy"

View File

@@ -0,0 +1,7 @@
FROM node:lts-slim
WORKDIR /app
COPY domain-redirect.mjs ./
CMD [ "node", "domain-redirect.mjs" ]

View File

@@ -0,0 +1,12 @@
import { Server } from "node:http"
const port = Number(process.env.PORT) || 3000
const server = new Server((request, response) => {
const url = new URL(request.url, `http://reacord.mapleleaf.dev`)
response.statusCode = 303
response.setHeader("Location", url.href)
response.end()
})
server.listen(port, () => {
console.info(`Listening on port ${port}`)
})