diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 300e47c8..4f98eb13 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,6 +17,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set ACTIVE_STORAGE_SERVICE to local in docker-compose.yml + uses: mikefarah/yq@4.44.6 + with: + cmd: yq eval '.services.web.environment["ACTIVE_STORAGE_SERVICE"] = "test"' -i docker-compose.yml + - name: Build Docker production image run: docker compose -f docker-compose.yml -f docker-compose-prod.yml build --build-arg ENVIRONMENT=production diff --git a/config/environments/development.rb b/config/environments/development.rb index 94429064..472e75c0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -64,7 +64,7 @@ Rails.application.configure do } # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local + config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_SERVICE') { :local } # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = ActiveModel::Type::Boolean.new.cast(ENV.fetch("EMAIL_RAISE_DELIVERY_ERRORS", "false")) diff --git a/config/environments/production.rb b/config/environments/production.rb index afce1447..af9bf7f6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -36,7 +36,7 @@ Rails.application.configure do # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :production + config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_SERVICE') { :production } # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil