Skip to content

Commit 3c4ace0

Browse files
committed
Revert to build-push-actions v2 again
1 parent 5008643 commit 3c4ace0

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

.github/workflows/docker-image.yml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Publish Docker image
33
on:
44
release:
55
types: [published]
6-
push:
7-
tags:
8-
- 0.*
96

107
jobs:
118
build_and_deploy:
@@ -15,7 +12,7 @@ jobs:
1512
- name: Prepare
1613
id: prep
1714
run: |
18-
DOCKER_IMAGE=mach
15+
DOCKER_IMAGE=docker.pkg.github.com/labd/mach-composer/mach
1916
VERSION=noop
2017
if [[ $GITHUB_REF == refs/tags/* ]]; then
2118
VERSION=${GITHUB_REF#refs/tags/}
@@ -25,13 +22,13 @@ jobs:
2522
VERSION=edge
2623
fi
2724
fi
28-
TAGS="${VERSION}"
25+
TAGS="${DOCKER_IMAGE}:${VERSION}"
2926
if [[ $VERSION =~ ^(v)?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
3027
MINOR=${VERSION%.*}
3128
MAJOR=${MINOR%.*}
32-
TAGS="$TAGS,${MINOR},${MAJOR},latest"
29+
TAGS="$TAGS,${DOCKER_IMAGE}:${MINOR},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest"
3330
elif [ "${{ github.event_name }}" = "push" ]; then
34-
TAGS="$TAGS,sha-${GITHUB_SHA::8}"
31+
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
3532
fi
3633
echo ::set-output name=version::${VERSION}
3734
echo ::set-output name=tags::${TAGS}
@@ -49,27 +46,19 @@ jobs:
4946
5047
- name: Check out the repo
5148
uses: actions/checkout@v2
52-
# - name: Login to GitHub packages
53-
# uses: docker/login-action@v1
54-
# with:
55-
# registry: docker.pkg.github.com
56-
# username: ${{ github.repository_owner }}
57-
# password: ${{ secrets.GITHUB_TOKEN }}
58-
# logout: false
59-
# - name: Push to GitHub Packages
60-
# uses: docker/build-push-action@v2
61-
# with:
62-
# context: .
63-
# file: ./Dockerfile
64-
# cache-from: type=local,src=/tmp/.buildx-cache
65-
# cache-to: type=local,dest=/tmp/.buildx-cache
66-
# tags: ${{ steps.prep.outputs.tags }}
67-
# push: true
68-
- name: Push to GitHub Packages
69-
uses: docker/build-push-action@v1
49+
- name: Login to GitHub packages
50+
uses: docker/login-action@v1
7051
with:
52+
registry: docker.pkg.github.com
7153
username: ${{ github.actor }}
7254
password: ${{ secrets.GITHUB_TOKEN }}
73-
registry: docker.pkg.github.com
74-
repository: labd/mach-composer/mach
75-
tags: ${{ steps.prep.outputs.tags }}
55+
logout: false
56+
- name: Push to GitHub Packages
57+
uses: docker/build-push-action@v2
58+
with:
59+
context: .
60+
file: ./Dockerfile
61+
cache-from: type=local,src=/tmp/.buildx-cache
62+
cache-to: type=local,dest=/tmp/.buildx-cache
63+
tags: ${{ steps.prep.outputs.tags }}
64+
push: true

0 commit comments

Comments
 (0)