File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,23 +59,26 @@ jobs:
5959 steps :
6060 - name : Checkout
6161 uses : actions/checkout@v3
62- - name : Get version
63- uses : actions/github-script@v6
64- id : version
62+ - name : Docker meta
63+ id : meta
64+ uses : docker/metadata-action@v4
6565 with :
66- result-encoding : string
67- script : return context.ref.split('/')[2].substring(1)
66+ images : |
67+ ghcr.io/${{ github.repository }}
68+ tags : |
69+ type=semver,pattern={{version}}
70+ type=semver,pattern={{major}}.{{minor}}
71+ type=semver,pattern={{major}}
6872 - name : Setup Docker
6973 uses : ./.github/actions/setup-docker
7074 with :
7175 registry_domain : ghcr.io
7276 registry_username : ${{ secrets.GH_USER }}
7377 registry_password : ${{ secrets.GH_TOKEN }}
74- - name : Build and push ${{ github.repository }}:${{ steps.version.outputs.result }}
78+ - name : Build and push
7579 uses : docker/build-push-action@v3
7680 with :
7781 push : true
7882 platforms : linux/amd64,linux/arm64
79- tags : |
80- ghcr.io/${{ github.repository }}:latest
81- ghcr.io/${{ github.repository }}:${{ steps.version.outputs.result }}
83+ tags : ${{ steps.meta.outputs.tags }}
84+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change @@ -39,5 +39,3 @@ ENTRYPOINT ["node"]
3939CMD ["server.js" ]
4040
4141USER node
42-
43- LABEL org.opencontainers.image.source https://github.com/makenew/nodejs-server
You can’t perform that action at this time.
0 commit comments