Skip to content

Commit cb5872c

Browse files
committed
version add
1 parent 82fecf5 commit cb5872c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/docker-publish.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: docker/setup-qemu-action@v3
2424
- uses: docker/setup-buildx-action@v3
2525

26-
- name: Build image to get commit hash
26+
- name: Build image to generate commit hash
2727
uses: docker/build-push-action@v6
2828
with:
2929
push: false
@@ -37,9 +37,14 @@ jobs:
3737
- name: Extract Asterisk commit hash
3838
id: commit
3939
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
4348
4449
- name: Build and push with commit tag
4550
uses: docker/build-push-action@v6

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ COPY --from=build /usr/lib64 /usr/lib64
103103
COPY --from=build /usr/sbin /usr/sbin
104104
COPY --from=build /var/lib/asterisk /var/lib/asterisk
105105
COPY --from=build /etc/asterisk /etc/asterisk
106+
COPY --from=build /tmp/asterisk-commit.txt /tmp/asterisk-commit.txt
106107

107108
# Set permissions for Asterisk
108109
RUN chown -R asterisk:asterisk /var/lib/asterisk && chmod -R 750 /var/lib/asterisk

0 commit comments

Comments
 (0)