File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,19 +19,23 @@ jobs:
1919 - uses : actions/checkout@v2
2020
2121 - name : Build image
22- run : docker build . --file ./php-alpine/Dockerfile --build-arg COMPOSER_VERSION=$COMPOSER_VERSION --tag $IMAGE_NAME:latest
22+ run : docker build . --file ./php-alpine/Dockerfile --build-arg COMPOSER_VERSION=$COMPOSER_VERSION --tag $IMAGE_NAME
2323
2424 - name : Log into GitHub Container Registry
25- run : echo "${{ secrets.SECRET_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
25+ run : echo "${{ secrets.SECRET_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
2626
2727 - name : Push image to GitHub Container Registry
2828 run : |
29- # Strip git ref prefix from version
29+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
30+
31+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
32+
3033 VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
31- # Strip "v" prefix from tag name
34+
3235 [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
33- IMAGE_ID=docker.pkg.github.com/brewmap/environment/$IMAGE_NAME
34- # Change all uppercase to lowercase
35- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
36+
37+ echo IMAGE_ID=$IMAGE_ID
38+ echo VERSION=$VERSION
39+
3640 docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
3741 docker push $IMAGE_ID:$VERSION
You can’t perform that action at this time.
0 commit comments