18
18
if : >
19
19
github.event_name != 'pull_request' ||
20
20
github.event.pull_request.head.repo.full_name != github.repository
21
+ # Export Docker image name used by dependent jobs
22
+ outputs :
23
+ image_name : ${{ steps.image_name.outputs.image_name }}
21
24
steps :
25
+ - name : Define Docker image name
26
+ id : image_name
27
+ # To satisfy Docker tag naming requirements, we replace all slashes
28
+ # in the ref name with dashes.
29
+ run : |
30
+ SANITIZED_REF_NAME="${GITHUB_REF_NAME//\//-}"
31
+ echo "Sanitized GITHUB_REF_NAME: $SANITIZED_REF_NAME"
32
+ IMAGE_NAME="ghcr.io/${GITHUB_REPOSITORY}:${SANITIZED_REF_NAME}"
33
+ echo "Image name: $IMAGE_NAME"
34
+ echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT
22
35
- name : Free Disk Space (Ubuntu)
23
36
uses : jlumbroso/free-disk-space@main
24
37
with :
39
52
cache-to : type=gha,mode=max`
40
53
file : util/container/Dockerfile
41
54
push : true
42
- tags : ghcr.io/ ${{ github.repository_owner }}/snitch_cluster:${{ github.ref_name }}
55
+ tags : ${{ steps.image_name.outputs.image_name }}
43
56
44
57
# #######
45
58
# Docs #
53
66
github.event_name != 'pull_request' ||
54
67
github.event.pull_request.head.repo.full_name != github.repository
55
68
container :
56
- image : ghcr.io/ ${{ github.repository_owner }}/snitch_cluster:${{ github.ref_name }}
69
+ image : ${{ needs.build-docker.outputs.image_name }}
57
70
steps :
58
71
- uses : actions/checkout@v2
59
72
- name : Build docs
93
106
github.event_name != 'pull_request' ||
94
107
github.event.pull_request.head.repo.full_name != github.repository
95
108
container :
96
- image : ghcr.io/ ${{ github.repository_owner }}/snitch_cluster:${{ github.ref_name }}
109
+ image : ${{ needs.build-docker.outputs.image_name }}
97
110
steps :
98
111
- uses : actions/checkout@v2
99
112
- name : Run pytest
@@ -111,7 +124,7 @@ jobs:
111
124
github.event_name != 'pull_request' ||
112
125
github.event.pull_request.head.repo.full_name != github.repository
113
126
container :
114
- image : ghcr.io/ ${{ github.repository_owner }}/snitch_cluster:${{ github.ref_name }}
127
+ image : ${{ needs.build-docker.outputs.image_name }}
115
128
steps :
116
129
- uses : actions/checkout@v2
117
130
with :
@@ -161,7 +174,7 @@ jobs:
161
174
github.event_name != 'pull_request' ||
162
175
github.event.pull_request.head.repo.full_name != github.repository
163
176
container :
164
- image : ghcr.io/ ${{ github.repository_owner }}/snitch_cluster:${{ github.ref_name }}
177
+ image : ${{ needs.build-docker.outputs.image_name }}
165
178
steps :
166
179
- uses : actions/checkout@v4
167
180
with :
0 commit comments