File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ push :
5+ tags : [v*]
6+
7+ permissions :
8+ packages : write
9+
10+ env :
11+ IMAGE_NAME : modrinth-publish
12+
13+ jobs :
14+ publish :
15+ name : Publish
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+
21+ - name : Build image
22+ run : docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
23+
24+ - name : Log in to GitHub Container Registry
25+ run : echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
26+
27+ - name : Push image
28+ run : |
29+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
30+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
31+ TAG=${GITHUB_REF#refs/tags/}
32+ VERSION=${TAG#v}
33+ docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
34+ docker push $IMAGE_ID:$VERSION
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ outputs:
5555 description : Version ID generated by Modrinth.
5656runs :
5757 using : docker
58- image : Dockerfile
58+ image : docker://ghcr.io/cloudnode-pro/modrinth-publish:2.0.0
5959 env :
6060 GH_INPUTS : ${{ toJSON(inputs) }}
6161branding :
You can’t perform that action at this time.
0 commit comments