File tree 4 files changed +17
-3
lines changed
lib/asciinema_web/controllers
4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 31
31
[[ "${{ github.ref_type }}" == "tag" ]] && IMAGE_TAG=$(echo $IMAGE_TAG | sed -e 's/^v//')
32
32
# Use Docker `latest` tag convention
33
33
[ "$IMAGE_TAG" == "main" ] && IMAGE_TAG=latest
34
+ VERSION="${{ github.sha }}"
35
+ [[ "${{ github.ref_type }}" == "tag" ]] && VERSION="${{ github.ref_name }}"
36
+ [[ "${{ github.ref_type }}" == "branch" ]] && VERSION="${{ github.ref_name }}-${{ github.sha }}"
34
37
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_OUTPUT
35
38
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_OUTPUT
39
+ echo VERSION=$VERSION >> $GITHUB_OUTPUT
36
40
37
41
- name : Set up Docker Buildx
38
42
uses : docker/setup-buildx-action@v3
46
50
47
51
- name : Build image
48
52
uses : docker/build-push-action@v5
53
+ env :
54
+ VERSION : " ${{ steps.vars.outputs.VERSION }}"
49
55
with :
50
56
context : .
51
57
push : true
Original file line number Diff line number Diff line change 7
7
# General application configuration
8
8
import Config
9
9
10
+ config :asciinema , version: System . get_env ( "VERSION" )
11
+
10
12
config :asciinema , :session_opts ,
11
13
store: :cookie ,
12
14
key: "_asciinema_key" ,
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ defmodule AsciinemaWeb.PageController do
9
9
"about.html" ,
10
10
page_title: "About" ,
11
11
contact_email_address: Application . get_env ( :asciinema , :contact_email_address ) ,
12
- server_name: AsciinemaWeb.Endpoint . host ( )
12
+ server_name: AsciinemaWeb.Endpoint . host ( ) ,
13
+ server_version: Application . get_env ( :asciinema , :version )
13
14
)
14
15
end
15
16
Original file line number Diff line number Diff line change 1
1
< h1 > About <%= @ server_name %> </ h1 >
2
2
3
3
< p >
4
- < strong > <%= @ server_name %> </ strong > is a platform for hosting and sharing
5
- terminal session recordings, powered by < a href = "https://docs.asciinema.org/manual/server/ " > asciinema server</ a > .
4
+ < strong > <%= @ server_name %> </ strong >
5
+ is a platform for hosting and sharing
6
+ terminal session recordings, powered by
7
+ < a href = "https://docs.asciinema.org/manual/server/ " > asciinema server</ a >
8
+ <%= if @ server_version do %>
9
+ (<%= @ server_version %> )
10
+ <% end %> .
6
11
</ p >
7
12
8
13
<%= if @ contact_email_address do %>
You can’t perform that action at this time.
0 commit comments