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: on:
push: push:
branches: [OAuth_Delegated_Token]
jobs: jobs:
build: build:
@ -12,6 +11,8 @@ jobs:
packages: write packages: write
steps: steps:
- uses: actions/checkout@v4 - 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 - uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
@ -22,6 +23,6 @@ jobs:
with: with:
context: . context: .
push: true push: true
tags: ghcr.io/system-end/theseus:latest tags: ghcr.io/${{ env.OWNER }}/theseus:latest
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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.delivery_method = :smtp
config.action_mailer.smtp_settings = { config.action_mailer.smtp_settings = {
address: "smtp.loops.so", address: ENV.fetch("SMTP_ADDRESS", "smtp.loops.so"),
port: 587, port: ENV.fetch("SMTP_PORT", 587).to_i,
user_name: "loops", user_name: ENV.fetch("SMTP_USERNAME", "loops"),
password: Rails.application.credentials.dig(:loops, :api_key), password: ENV["SMTP_PASSWORD"] || Rails.application.credentials.dig(:loops, :api_key),
authentication: "plain", authentication: "plain",
enable_starttls: true enable_starttls: true
} }