File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 62
62
echo VERSION=$VERSION
63
63
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
64
64
docker push $IMAGE_ID:$VERSION
65
+
66
+ push-multiplatform :
67
+ name : Push multi platform
68
+ needs : build-linux
69
+ runs-on : ubuntu-latest
70
+ if : ${{ github.event_name != 'pull_request' }}
71
+ steps :
72
+ - name : Log in to registry
73
+ if : ${{ github.event_name != 'pull_request' }}
74
+ # This is where you will update the PAT to GITHUB_TOKEN
75
+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
76
+
77
+ - name : Get images
78
+ shell : bash
79
+ run : |
80
+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
81
+
82
+ # Change all uppercase to lowercase
83
+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
84
+ # Strip git ref prefix from version
85
+ VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
86
+ # Strip "v" prefix from tag name
87
+ [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
88
+ # Use Docker `latest` tag convention
89
+ [ "$VERSION" == "main" ] && VERSION=latest
90
+ docker manifest create $IMAGE_ID:$VERSION $IMAGE_ID:$VERSION-arm64 $IMAGE_ID:$VERSION-x86_64
91
+ docker manifest push $IMAGE_ID:$VERSION
You can’t perform that action at this time.
0 commit comments