Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show version number in footer #329

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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