-
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.
Add docker workflow, add test endpoint, improve notification payload (#2
) * Add docker build/push workflow * Allow postgres customizations * Use postgres host env var in Dockerfile * Add fallbacks for unset env vars * Don't crash app if APN info not provided * Update TS * log -> warn * Create Thunder database if not exists * Add ability to generate test notification * Increase fetch timeout * Add sort type * Use slim payload object
- Loading branch information
Showing
14 changed files
with
182 additions
and
27 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: Publish Docker Image | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Build | ||
- name: Build image | ||
run: | | ||
[[ $GITHUB_REF_NAME = "main" ]] && TAG="latest" || TAG=$GITHUB_REF_NAME | ||
TAG="${TAG//\//$'-'}" | ||
docker build . --file Dockerfile --tag ghcr.io/"${GITHUB_REPOSITORY,,}":$TAG | ||
# Push | ||
- name: Push image | ||
run: | | ||
[[ $GITHUB_REF_NAME = "main" ]] && TAG="latest" || TAG=$GITHUB_REF_NAME | ||
TAG="${TAG//\//$'-'}" | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_REPOSITORY_OWNER --password-stdin | ||
docker push ghcr.io/"${GITHUB_REPOSITORY,,}":$TAG |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
CommentReplyView, | ||
} from "lemmy-js-client"; | ||
|
||
export type SlimCommentReplyView = { | ||
comment_reply_id: number, | ||
comment_content: string, | ||
comment_removed: boolean, | ||
comment_deleted: boolean, | ||
creator_name: string, | ||
creator_actor_id: string, | ||
post_name: string, | ||
community_name: string, | ||
community_actor_id: string, | ||
recipient_name: string, | ||
recipient_actor_id: string, | ||
} | ||
|
||
export function createSlimCommentReplyView(reply: CommentReplyView | undefined): SlimCommentReplyView | undefined { | ||
if (!reply) return undefined; | ||
|
||
return { | ||
comment_reply_id: reply.comment_reply.id, | ||
comment_content: reply.comment.content, | ||
comment_removed: reply.comment.removed, | ||
comment_deleted: reply.comment.deleted, | ||
creator_name: reply.creator.name, | ||
creator_actor_id: reply.creator.actor_id, | ||
post_name: reply.post.name, | ||
community_name: reply.community.name, | ||
community_actor_id: reply.community.actor_id, | ||
recipient_name: reply.recipient.name, | ||
recipient_actor_id: reply.recipient.actor_id, | ||
}; | ||
} | ||
|
||
// TODO: Add slim models for mentions and messages |
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,11 +1,12 @@ | ||
import { | ||
CommentReplyView, | ||
PersonMentionView, | ||
PrivateMessageView, | ||
} from "lemmy-js-client"; | ||
|
||
import { SlimCommentReplyView } from "./lemmy"; | ||
|
||
export type UnifiedPushObject = { | ||
mention: PersonMentionView | undefined, | ||
reply: CommentReplyView | undefined, | ||
reply: SlimCommentReplyView | undefined, | ||
message: PrivateMessageView | undefined | ||
}; |