@@ -113,115 +113,24 @@ jobs:
113113 file : ./services/app/assp/codebattle/cover/excoveralls.json
114114 fail_ci_if_error : false
115115
116- codebattle-docker :
117- if : github.repository == 'hexlet-codebattle/codebattle'
118- runs-on : ubuntu-latest
119- timeout-minutes : 30 # Add timeout to prevent hanging builds
120- needs : build
121-
122- steps :
123- - uses : actions/checkout@v4
124-
125- - name : Set up Docker Buildx
126- uses : docker/setup-buildx-action@v3
127-
128116 - name : Login to Docker Hub
129117 uses : docker/login-action@v3
130118 with :
131119 username : ${{ secrets.DOCKER_USERNAME }}
132120 password : ${{ secrets.DOCKER_PASSWORD }}
133121
134- - name : Build codebattle assets-image
135- uses : docker/build-push-action@v6
136- with :
137- context : services/app
138- file : services/app/Dockerfile.codebattle
139- build-args : |
140- GIT_HASH=${{ github.sha }}
141- push : ${{ github.ref_name == 'master' }}
142- target : assets-image
143- tags : codebattle/codebattle:assets-image
144- # cache-to: type=registry,ref=codebattle/codebattle:assets-image-buildcache
145- # cache-from: type=registry,ref=codebattle/codebattle:assets-image-buildcache,image-manifest=true
146-
147- - name : Build codebattle compile-image
148- uses : docker/build-push-action@v6
149- with :
150- context : services/app
151- file : services/app/Dockerfile.codebattle
152- build-args : |
153- GIT_HASH=${{ github.sha }}
154- push : ${{ github.ref_name == 'master' }}
155- target : compile-image
156- tags : codebattle/codebattle:compile-image
157- # cache-to: type=registry,ref=codebattle/codebattle:compile-image-buildcache
158- # cache-from: type=registry,ref=codebattle/codebattle:compile-image-buildcache,image-manifest=true
159-
160- - name : Build codebattle nginx-assets
161- uses : docker/build-push-action@v6
162- with :
163- context : services/app
164- file : services/app/Dockerfile.codebattle
165- build-args : |
166- GIT_HASH=${{ github.sha }}
167- push : ${{ github.ref_name == 'master' }}
168- target : nginx-assets
169- tags : codebattle/codebattle:nginx-assets
170- # cache-to: type=registry,ref=codebattle/codebattle:nginx-assets-buildcache
171- # cache-from: type=registry,ref=codebattle/codebattle:nginx-assets-buildcache,image-manifest=true
172-
173- - name : Build codebattle runtime-image
174- uses : docker/build-push-action@v6
175- with :
176- context : services/app
177- file : services/app/Dockerfile.codebattle
178- build-args : |
179- GIT_HASH=${{ github.sha }}
180- push : ${{ github.ref_name == 'master' }}
181- target : runtime-image
182- tags : codebattle/codebattle:latest
183- # cache-to: type=registry,ref=codebattle/codebattle:runtime-image-buildcache
184- # cache-from: type=registry,ref=codebattle/codebattle:runtime-image-buildcache,image-manifest=true
185-
186- runner-docker :
187- if : github.repository == 'hexlet-codebattle/codebattle'
188- runs-on : ubuntu-latest
189- timeout-minutes : 30 # Add timeout to prevent hanging builds
190- needs : build
191-
192- steps :
193- - uses : actions/checkout@v4
194-
195122 - name : Set up Docker Buildx
196123 uses : docker/setup-buildx-action@v3
197124
198- - name : Login to Docker Hub
199- uses : docker/login-action@v3
200- with :
201- username : ${{ secrets.DOCKER_USERNAME }}
202- password : ${{ secrets.DOCKER_PASSWORD }}
125+ - name : Build and push codebattle image
126+ run : |
127+ make GIT_HASH=${{ github.sha }} docker-build-codebattle
128+ make docker-push-codebattle
203129
204- - name : Build runner compile-image
205- uses : docker/build-push-action@v6
206- with :
207- context : services/app
208- file : services/app/Dockerfile.runner
209- push : ${{ github.ref_name == 'master' }}
210- target : compile-image
211- tags : codebattle/runner:compile-image
212- # cache-to: type=registry,ref=codebattle/runner:compile-image-buildcache
213- # cache-from: type=registry,ref=codebattle/runner:compile-image-buildcache,image-manifest=true
214-
215- - name : Build runner runtime-image
216- uses : docker/build-push-action@v6
217- with :
218- context : services/app
219- file : services/app/Dockerfile.runner
220- push : ${{ github.ref_name == 'master' }}
221- target : runtime-image
222- tags : codebattle/runner:latest
223- # cache-to: type=registry,ref=codebattle/runner:runtime-image-buildcache
224- # cache-from: type=registry,ref=codebattle/runner:runtime-image-buildcache,image-manifest=true
130+ - name : Build and push runner image
131+ run : |
132+ make docker-build-runner
133+ make docker-push-runner
225134
226135 # stop integratoin tests on CI becaues of https://github.com/hexlet-codebattle/codebattle/runs/580337561?check_suite_focus=true
227136 # - name: Pull dockers
0 commit comments