Skip to content

Commit

Permalink
all for setting rails env
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry committed Aug 13, 2021
1 parent c4f7a38 commit 1fd63d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
build-args: |
DEVISE_SECRET=${{ env.DEVISE_SECRET }}
RAILS_ENV=production
NODE_ENV=production
push: false
load: true
# target: development
Expand All @@ -93,7 +95,7 @@ jobs:
- name: Run specs
run: |
docker run -d --name="test-database" --hostname "postgres" -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" postgres:latest
docker run --network "container:test-database" -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" $CONTAINER_TEST_REPOSITORY /bin/sh -c "bundle exec rake db:create db:structure:load; bundle exec rspec"
docker run --network "container:test-database" -e RAILS_ENV=test -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" $CONTAINER_TEST_REPOSITORY /bin/sh -c "bundle exec rake db:create db:structure:load; bundle exec rspec"
# The docker pull does not work
- name: Run security tests
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-prod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ FROM --platform=linux/x86_64 ruby:2.7.2-alpine as base
ENV LANG C.UTF-8 # ensure that the encoding is UTF8
ENV LANGUAGE C.UTF-8 # ensure that the encoding is UTF8

ENV RAILS_ENV production
ENV NODE_ENV production
ARG RAILS_ENV=production
ARG NODE_ENV=production

# Use a persistent volume for the gems installed by the bundler
ENV BUNDLE_PATH /var/bundler
Expand Down

0 comments on commit 1fd63d3

Please sign in to comment.