Skip to content

Commit a6505e4

Browse files
committed
fix: Load .env variables before asset precompilation
Fixes SECRET_KEY_BASE missing error during deployment by loading environment variables from .env file before running Rails tasks.
1 parent d9adb64 commit a6505e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
echo "📦 Installing dependencies..."
6464
bundle install --deployment --without development test
6565
66+
# Load environment variables
67+
export $(cat .env | grep -v '^#' | xargs)
68+
6669
# Precompile assets
6770
echo "🎨 Precompiling assets..."
6871
RAILS_ENV=production bundle exec rails assets:precompile

0 commit comments

Comments
 (0)