Skip to content

Commit

Permalink
add email subject & service deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehobbs committed Jan 19, 2024
1 parent d773d86 commit 097c00d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
deploy:
deploy_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -45,3 +45,18 @@ jobs:
AWS_REGION: "us-west-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
deploy_service:
runs-on: ubuntu-latest
if: "github.event_name == 'push' && github.event_path == 'service'"
steps:
- uses: actions/checkout@v2
- run: cd service
- name: Build image & push to ECR
uses: kciter/aws-ecr-action@master
with:
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
repo: dxe/helptheducks-service
region: us-west-2
tags: latest,${{ github.sha }}
10 changes: 10 additions & 0 deletions service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.21.6-alpine AS builder
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN go build -o service .

FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /app/service /service
ENTRYPOINT ["./service"]
5 changes: 3 additions & 2 deletions service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ func processNewMessages() {
err := mailer.Send(mailClient, mailer.SendOptions{
From: fmt.Sprintf("%s <%s>", message.Name, fromEmail),
ReplyTo: message.Email,
To: "[email protected]", // TODO
Subject: "Testing email", // TODO
// TODO: change this after confirming everything is working okay
To: "[email protected]",
Subject: "Prosecute Reichardt Duck Farm for Animal Abuse",
Body: message.Message,
})
if err != nil {
Expand Down

0 comments on commit 097c00d

Please sign in to comment.