Skip to content

Commit dd80f47

Browse files
committed
chore: update Docker workflow to push image to ghcr with sudo and log in with github token
1 parent c115ba4 commit dd80f47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish-docker.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
run: sudo docker build . --file Dockerfile.prod --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
3434

3535
- name: Log in to registry
36-
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
37-
#
36+
run: echo "${{ secrets.ACCESS_TOKEN }}" | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin
37+
3838
- name: Push image
3939
run: |
4040
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
@@ -45,7 +45,7 @@ jobs:
4545
if [ -n "${{ github.event.inputs.version }}" ]; then
4646
VERSION=${{ github.event.inputs.version }}
4747
else
48-
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
48+
VERSION=$(echo "${{ github.ref }}")
4949
fi
5050
5151
# This strips the "v" prefix from the tag name.
@@ -54,5 +54,5 @@ jobs:
5454
[ "$VERSION" == "master" ] && VERSION=latest
5555
echo IMAGE_ID=$IMAGE_ID
5656
echo VERSION=$VERSION
57-
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
57+
sudo docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
5858
sudo docker push $IMAGE_ID:$VERSION

0 commit comments

Comments
 (0)