-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Only merge using a merge commit!**
- Loading branch information
Showing
26 changed files
with
76 additions
and
338 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deploy email-function | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/deploy-email-function.yml | ||
- .github/workflows/build-email-function.yml | ||
- bun-packages/** | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-email-function.yml | ||
|
||
deploy: | ||
runs-on: ubuntu-22.04 | ||
|
||
# Related | ||
# - https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | ||
# - https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps | ||
permissions: | ||
id-token: write # Required for aws-actions/configure-aws-credentials | ||
contents: read # Required for aws-actions/configure-aws-credentials | ||
|
||
needs: [build] | ||
|
||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4.0.2 | ||
with: | ||
role-to-assume: arn:aws:iam::197170241226:role/github-actions | ||
aws-region: eu-central-1 | ||
|
||
- name: Retrieve email-function artifact | ||
uses: actions/download-artifact@v4.1.6 | ||
with: | ||
name: email-function-dist | ||
path: bun-packages/packages/email-function/dist | ||
|
||
- name: Prepare ZIP | ||
run: zip --recurse-paths dist.zip dist | ||
working-directory: bun-packages/packages/email-function/ | ||
|
||
- name: Deploy | ||
run: aws lambda update-function-code --function-name email-function --zip-file fileb://dist.zip | ||
working-directory: bun-packages/packages/email-function/ |
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
23 changes: 3 additions & 20 deletions
23
bun-packages/packages/email-function/src/_lib/logging/console.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 |
---|---|---|
@@ -1,32 +1,15 @@ | ||
import { type LogOutput } from "./types"; | ||
|
||
export const logToConsole: LogOutput = (logEntry) => { | ||
const { timestamp, ...rest } = logEntry; | ||
|
||
switch (logEntry.level) { | ||
case "info": | ||
console.info( | ||
JSON.stringify({ | ||
timestamp: timestamp.toISOString(), | ||
...rest, | ||
}), | ||
); | ||
console.info(JSON.stringify(logEntry)); | ||
break; | ||
case "warn": | ||
console.warn( | ||
JSON.stringify({ | ||
timestamp: timestamp.toISOString(), | ||
...rest, | ||
}), | ||
); | ||
console.warn(JSON.stringify(logEntry)); | ||
break; | ||
case "error": | ||
console.error( | ||
JSON.stringify({ | ||
timestamp: timestamp.toISOString(), | ||
...rest, | ||
}), | ||
); | ||
console.error(JSON.stringify(logEntry)); | ||
break; | ||
} | ||
}; |
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
4 changes: 2 additions & 2 deletions
4
bun-packages/packages/email-function/src/_lib/logging/types.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export interface LogEntry { | ||
timestamp: Date; | ||
timestamp: string; | ||
level: "info" | "warn" | "error"; | ||
message: string; | ||
commitSha?: string; | ||
[key: string]: unknown; | ||
[key: string]: string | number | boolean | undefined; | ||
} | ||
|
||
export type LogOutput = (logEntry: LogEntry) => void; |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.