|
39 | 39 | run_pkgdown: 'false' |
40 | 40 | has_RUnit: 'false' |
41 | 41 | cache-version: 'cache-v1' |
42 | | - run_docker: 'false' |
| 42 | + run_docker: 'true' |
43 | 43 |
|
44 | 44 | jobs: |
45 | 45 | build-check: |
@@ -292,50 +292,32 @@ jobs: |
292 | 292 | path: check |
293 | 293 |
|
294 | 294 |
|
295 | | - ## Code adapted from |
296 | | - ## https://github.com/waldronlab/cBioPortalData/blob/e0440a4445f0cc731e426363a76faa22ee5e0f9d/.github/workflows/devel_check_dock.yml#L65-L92 |
297 | | - docker-build-and-push: |
| 295 | +docker-build-and-push: |
298 | 296 | runs-on: ubuntu-latest |
299 | 297 | needs: build-check |
| 298 | + if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
300 | 299 | steps: |
301 | 300 | - name: Checkout Repository |
302 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
303 | 301 | uses: actions/checkout@v3 |
304 | 302 |
|
305 | | - - name: Register repo name |
306 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
307 | | - id: reg_repo_name |
| 303 | + - name: Set repository name as environment variable |
308 | 304 | run: | |
309 | | - echo CONT_IMG_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV |
310 | | -
|
311 | | - - name: Set up QEMU |
312 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
313 | | - uses: docker/setup-qemu-action@v2 |
| 305 | + echo CONT_IMG_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV |
314 | 306 |
|
315 | 307 | - name: Set up Docker Buildx |
316 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
317 | 308 | uses: docker/setup-buildx-action@v2 |
318 | 309 |
|
319 | 310 | - name: Login to Docker Hub |
320 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'" |
321 | 311 | uses: docker/login-action@v2 |
322 | 312 | with: |
323 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
324 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
325 | | - ## Note that DOCKERHUB_TOKEN is really a token for your dockerhub |
326 | | - ## account, not your actual dockerhub account password. You can get it |
327 | | - ## from https://hub.docker.com/settings/security. |
328 | | - ## Check https://github.com/docker/build-push-action/tree/v4.0.0 |
329 | | - ## for more details. |
330 | | - ## Alternatively, try checking |
331 | | - ## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html. |
| 313 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 314 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
332 | 315 |
|
333 | 316 | - name: Build and Push Docker |
334 | | - if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel' && success()" |
335 | 317 | uses: docker/build-push-action@v4 |
336 | 318 | with: |
337 | | - context: . |
338 | | - push: true |
339 | | - tags: > |
340 | | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:latest, |
341 | | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:devel |
| 319 | + context: . |
| 320 | + push: true |
| 321 | + tags: | |
| 322 | + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:latest |
| 323 | + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:devel |
0 commit comments