Skip to content

Commit

Permalink
Add code version to docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
phylor committed Oct 2, 2022
1 parent e453a4c commit a3acb90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: CODE_VERSION:${{ steps.meta.outputs.tags[0] }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ COPY Gemfile /app
COPY Gemfile.lock /app
RUN bundle config set --local without 'development test'; bundle install

ARG CODE_VERSION
ENV CODE_VERSION=${CODE_VERSION:-development}

COPY . /app
RUN bin/rails assets:precompile

Expand Down
5 changes: 5 additions & 0 deletions app/views/pages/home.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@
- if lookup_context.exists?('data_privacy', 'pages')
.pl-3.text-xs.text-grey-foreground.dark:text-dark-grey-foreground(style="grid-column: span 2")
= link_to t('footer.data_privacy'), page_path(:data_privacy)

- if ENV["CODE_VERSION"].present?
.pl-3.text-xs.text-grey-foreground.dark:text-dark-grey-foreground(style="grid-column: span 2")
version
= ENV["CODE_VERSION"]

0 comments on commit a3acb90

Please sign in to comment.