File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 11name : Node.js CI - Dockge
22
3+ env :
4+ IMAGE_NAME : Dockge
5+
36on :
47 push :
58 branches : [master]
5962
6063 - name : Build
6164 run : pnpm run build:frontend
62- # more things can be add later like tests etc..
65+
66+ - name : Build image
67+ run : docker build . --file docker/Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
68+
69+ - name : Log in to registry
70+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
71+
72+ - name : Push image
73+ run : |
74+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
75+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
76+ VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
77+ [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
78+ [ "$VERSION" == "main" ] && VERSION=latest
79+ echo IMAGE_ID=$IMAGE_ID
80+ echo VERSION=$VERSION
81+ docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
82+ docker push $IMAGE_ID:$VERSION
6383
You can’t perform that action at this time.
0 commit comments