-
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.
build: 👷 Build Docker image for demo
- Loading branch information
Showing
11 changed files
with
4,771 additions
and
2,465 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,24 @@ | ||
name: Build & Publish Docker image for demo | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-publish-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
load: true | ||
tags: fidbee-demo:latest |
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,2 +1,3 @@ | ||
node_modules/ | ||
*.log | ||
*.log | ||
.yarn |
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 @@ | ||
nodeLinker: node-modules |
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,19 @@ | ||
FROM node:alpine AS build | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN yarn | ||
WORKDIR /app/lib | ||
RUN yarn build | ||
WORKDIR /app/demo | ||
RUN yarn build | ||
|
||
FROM denoland/deno:ubuntu-1.35.2 | ||
|
||
WORKDIR /app | ||
COPY ./server-example . | ||
COPY --from=build /app/demo/dist ./assets | ||
|
||
EXPOSE 8080 | ||
|
||
CMD deno run -A 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "fidbee", | ||
"name": "fidbee-ws", | ||
"private": true, | ||
"workspaces": [ | ||
"lib", | ||
|
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
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,16 +1,20 @@ | ||
import { SMTPClient, SendConfig } from "https://deno.land/x/denomailer/mod.ts"; | ||
import { html } from "https://deno.land/x/html/mod.ts"; | ||
import "https://deno.land/[email protected]/dotenv/load.ts"; | ||
import { load } from "https://deno.land/[email protected]/dotenv/mod.ts"; | ||
|
||
await load({ allowEmptyValues: true, examplePath: "" }); | ||
|
||
const emailTo = | ||
Deno.env.get("SMTP_RECEIVER") || Deno.env.get("SMTP_SENDER") || ""; | ||
|
||
export default (payload: FeedbackPayload) => | ||
sendEmail({ | ||
to: emailTo, | ||
subject: `New feedback by Fidbee for project ${payload.projectName}`, | ||
html: formatEmailContent(payload), | ||
}); | ||
export default (payload: FeedbackPayload) => { | ||
if (emailTo) | ||
sendEmail({ | ||
to: emailTo, | ||
subject: `New feedback by Fidbee for project ${payload.projectName}`, | ||
html: formatEmailContent(payload), | ||
}); | ||
}; | ||
|
||
const formatEmailContent = (payload: FeedbackPayload) => html`<div> | ||
<p>You received a new feedback by Fidbee:</p> | ||
|
Oops, something went wrong.