diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 35f6926d35..0271bee849 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -96,6 +96,7 @@ jobs: with: build-args: | BUILDKIT_INLINE_CACHE=1 + RAILS_MASTER_KEY=${{ secrets.RAILS_MASTER_KEY }} # Cache from builder target tagged with branch name, may be empty first time branch is pushed # Cache from builder target tagged with main branch name, always present, maybe less recent cache-from: | @@ -112,6 +113,7 @@ jobs: build-args: | BUILDKIT_INLINE_CACHE=1 COMMIT_SHA=${{ env.COMMIT_SHA }} + RAILS_MASTER_KEY=${{ secrets.RAILS_MASTER_KEY }} # Cache from builder target built above, always present # Cache from production target tagged with branch name, may be empty first time branch is pushed # Cache from production target tagged with main branch name, always present, maybe less recent diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b339782cb8..2f33b1635b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -72,8 +72,9 @@ jobs: runs-on: ubuntu-20.04 env: - RAILS_ENV: test DATABASE_URL: postgis://postgres:postgres@localhost:5432/tvs_test + RAILS_ENV: test + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} services: postgres: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17d67393e6..3981894ca5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,8 +32,9 @@ jobs: params: '--exclude-pattern "spec/{system}/*_spec.rb, spec/system/{jobseekers,publishers,support_users,other}/*_spec.rb"' env: - RAILS_ENV: test DATABASE_URL: postgis://postgres:postgres@localhost:5432/tvs_test + RAILS_ENV: test + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} services: postgres: diff --git a/Dockerfile b/Dockerfile index 131b8fbae4..857a0aaadf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,9 +32,11 @@ COPY . . # configuring it using the ENV variables we provide in storage.yml. However, at this point, these ENV vars have not been loaded, # causing the error. Below we define two throaway ENV vars to prevent the error from being thrown. These are then later overwritten, # when all of the ENV vars are loaded. +ARG RAILS_MASTER_KEY ENV DOCUMENTS_S3_BUCKET=throwaway_value ENV SCHOOLS_IMAGES_LOGOS_S3_BUCKET=throwaway_value +ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY RUN RAILS_ENV=production SECRET_KEY_BASE=required-to-run-but-not-used RAILS_SERVE_STATIC_FILES=1 bundle exec rake assets:precompile