Skip to content

Commit

Permalink
show version number in footer (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
klausmeyer committed Dec 28, 2023
1 parent f5397ea commit 4652641
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
build-args: |
SOURCE_COMMIT=${{ github.sha }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@
TV information and images are provided by <a target="_blank" href="https://www.thetvdb.com/">TheTVDB.com</a>, but we are not endorsed or certified by <a target="_blank" href="https://www.thetvdb.com/">TheTVDB.com</a> or its affiliates.
<br>
<% if last_updated_episode = Episode.order(updated_at: :desc).first %>
Last update: <%= l last_updated_episode.updated_at, format: :long %>
Last content update: <%= l last_updated_episode.updated_at, format: :long %>
&middot;
<% end %>
Version: <%= Rails.application.config.x.version %>
&middot;
Code available on <a href="https://github.com/klausmeyer/whatchy">GitHub</a> :)
</div>
Expand Down
7 changes: 7 additions & 0 deletions config/initializers/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Rails.application.config.x.version = "0.1.0"

# Docker Cloud will pass the git commit it is building the image from
# See: https://docs.docker.com/docker-hub/builds/advanced/
if (sha = ENV["SOURCE_COMMIT"].presence || ENV["SOURCE_VERSION"].presence)
Rails.application.config.x.version << " (#{sha[0...7]})"
end

0 comments on commit 4652641

Please sign in to comment.