Use ENV vars for SMTP config in production; build on all branches

This commit is contained in:
End 2026-04-02 05:25:45 -07:00
parent 0201df9a33
commit 104a9437bd
No known key found for this signature in database
3 changed files with 9 additions and 7 deletions

View file

@ -2,7 +2,6 @@ name: Build and push Docker image
on:
push:
branches: [OAuth_Delegated_Token]
jobs:
build:
@ -12,6 +11,8 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
- name: Set lowercase owner
run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- uses: docker/login-action@v3
with:
registry: ghcr.io
@ -22,6 +23,6 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/system-end/theseus:latest
tags: ghcr.io/${{ env.OWNER }}/theseus:latest
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -1 +1,2 @@
FROM ghcr.io/system-end/theseus:latest
ARG OWNER=system-end
FROM ghcr.io/${OWNER}/theseus:latest

View file

@ -61,10 +61,10 @@ Rails.application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.loops.so",
port: 587,
user_name: "loops",
password: Rails.application.credentials.dig(:loops, :api_key),
address: ENV.fetch("SMTP_ADDRESS", "smtp.loops.so"),
port: ENV.fetch("SMTP_PORT", 587).to_i,
user_name: ENV.fetch("SMTP_USERNAME", "loops"),
password: ENV["SMTP_PASSWORD"] || Rails.application.credentials.dig(:loops, :api_key),
authentication: "plain",
enable_starttls: true
}