7575 with :
7676 token : ${{ secrets.GITHUB_TOKEN }}
7777
78+ docker-build :
79+ name : Build Docker Image
80+ runs-on : ubuntu-latest
81+ needs : [test, clippy, fmt]
82+ if : github.ref != 'refs/heads/main'
83+ steps :
84+ - name : Checkout code
85+ uses : actions/checkout@v4
86+
87+ - name : Set up Docker Buildx
88+ uses : docker/setup-buildx-action@v3
89+
90+ - name : Build
91+ uses : docker/build-push-action@v5
92+ with :
93+ context : .
94+ push : false
95+ no-cache : true
96+
7897 docker-publish :
7998 name : Build and Publish Docker Image
8099 runs-on : ubuntu-latest
@@ -94,11 +113,12 @@ jobs:
94113 - name : Set up Docker Buildx
95114 uses : docker/setup-buildx-action@v3
96115
97- - name : Login to Docker Hub
116+ - name : Login to GitHub Container Registry
98117 uses : docker/login-action@v3
99118 with :
100- username : ${{ secrets.DOCKER_USERNAME }}
101- password : ${{ secrets.DOCKER_TOKEN }}
119+ registry : ghcr.io
120+ username : ${{ github.actor }}
121+ password : ${{ secrets.GITHUB_TOKEN }}
102122
103123 - name : Build and push
104124 uses : docker/build-push-action@v5
@@ -107,5 +127,5 @@ jobs:
107127 push : true
108128 no-cache : true
109129 tags : |
110- dbrgn/xc-bot:${{ steps.version.outputs.branch }}
111- dbrgn/xc-bot:${{ steps.version.outputs.version }}
130+ ghcr.io/ dbrgn/xc-bot:${{ steps.version.outputs.branch }}
131+ ghcr.io/ dbrgn/xc-bot:${{ steps.version.outputs.version }}
0 commit comments