File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 23
23
- uses : docker/setup-qemu-action@v3
24
24
- uses : docker/setup-buildx-action@v3
25
25
26
- - name : Build image to get commit hash
26
+ - name : Build image to generate commit hash
27
27
uses : docker/build-push-action@v6
28
28
with :
29
29
push : false
37
37
- name : Extract Asterisk commit hash
38
38
id : commit
39
39
run : |
40
- COMMIT_HASH=$(docker run --rm temp-image cat /tmp/asterisk-commit.txt | tr -d '\n')
41
- echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT
42
- echo "Asterisk commit hash: ${COMMIT_HASH}"
40
+ if [ -f /tmp/asterisk-commit.txt ]; then
41
+ COMMIT_HASH=$(cat /tmp/asterisk-commit.txt | tr -d '\n')
42
+ echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT
43
+ echo "Asterisk commit hash: ${COMMIT_HASH}"
44
+ else
45
+ echo "File /tmp/asterisk-commit.txt not found"
46
+ exit 1
47
+ fi
43
48
44
49
- name : Build and push with commit tag
45
50
uses : docker/build-push-action@v6
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ COPY --from=build /usr/lib64 /usr/lib64
103
103
COPY --from=build /usr/sbin /usr/sbin
104
104
COPY --from=build /var/lib/asterisk /var/lib/asterisk
105
105
COPY --from=build /etc/asterisk /etc/asterisk
106
+ COPY --from=build /tmp/asterisk-commit.txt /tmp/asterisk-commit.txt
106
107
107
108
# Set permissions for Asterisk
108
109
RUN chown -R asterisk:asterisk /var/lib/asterisk && chmod -R 750 /var/lib/asterisk
You can’t perform that action at this time.
0 commit comments