|
16 | 16 | DEV_CONTAINER_REGISTRY: ${{ vars.DEV_CONTAINER_REGISTRY }}
|
17 | 17 | DEV_LOGIN_USERNAME: ${{ secrets.DEV_LOGIN_USERNAME }}
|
18 | 18 | DEV_LOGIN_PASSWORD: ${{ secrets.DEV_LOGIN_PASSWORD }}
|
| 19 | + DOCKERHUB_CONTAINER_REGISTRY: ${{ vars.DOCKERHUB_CONTAINER_REGISTRY }} |
| 20 | + DOCKERHUB_LOGIN_USERNAME: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }} |
| 21 | + DOCKERHUB_LOGIN_PASSWORD: ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }} |
19 | 22 | IMAGE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.sha }}
|
20 | 23 | steps:
|
21 | 24 | - name: Checkout repository
|
|
47 | 50 | registry: "${{ env.DEV_CONTAINER_REGISTRY }}"
|
48 | 51 | username: "${{ env.DEV_LOGIN_USERNAME }}"
|
49 | 52 | password: "${{ env.DEV_LOGIN_PASSWORD }}"
|
| 53 | + |
| 54 | + - name: Log into Docker Hub registry |
| 55 | + uses: docker/login-action@v3 |
| 56 | + with: |
| 57 | + username: "${{ env.DOCKERHUB_LOGIN_USERNAME }}" |
| 58 | + password: "${{ env.DOCKERHUB_LOGIN_PASSWORD }}" |
50 | 59 |
|
51 | 60 | - name: Build & Push ${{ github.event.repository.name }}:amd64
|
52 | 61 | if: ${{ github.event_name != 'release' }}
|
|
76 | 85 | platform=linux/arm64
|
77 | 86 | label=dockerfile-path=https://github.com/${{ github.repository }}/blob/${{ github.sha }}/Dockerfile
|
78 | 87 |
|
79 |
| - - name: Build & Push ${{ github.event.repository.name }}:${{ env.IMAGE_TAG }} |
| 88 | + - name: Build & Push ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ env.IMAGE_TAG }} |
80 | 89 | uses: docker/build-push-action@v5
|
81 | 90 | with:
|
82 | 91 | cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:latest-cache
|
|
89 | 98 | platform=linux/amd64
|
90 | 99 | label=dockerfile-path=https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ env.DOCKERFILE }}
|
91 | 100 |
|
| 101 | + - name: Build & Push ${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ env.IMAGE_TAG }} |
| 102 | + uses: docker/build-push-action@v5 |
| 103 | + if: ${{ github.event_name == 'release' }} |
| 104 | + with: |
| 105 | + cache-from: type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:latest-cache |
| 106 | + cache-to: type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:latest-cache,mode=max,image-manifest=true |
| 107 | + platforms: linux/amd64 |
| 108 | + file: ${{ env.DOCKERFILE }} |
| 109 | + tags: ${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ env.IMAGE_TAG }} |
| 110 | + push: true |
| 111 | + build-args: | |
| 112 | + platform=linux/amd64 |
| 113 | + label=dockerfile-path=https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ env.DOCKERFILE }} |
| 114 | +
|
92 | 115 | - name: Build & Push ${{ github.event.repository.name }}:latest
|
93 | 116 | uses: docker/build-push-action@v5
|
94 | 117 | with:
|
|
0 commit comments