|
| 1 | +name: Publish Dockers |
| 2 | +on: |
| 3 | + workflow_dispatch |
| 4 | + |
| 5 | +env: |
| 6 | + REGISTRY: ghcr.io |
| 7 | + IMAGE_NAME: TissueImageAnalytics/tiatoolbox |
| 8 | + image: ghcr.io/tissueimageanalytics/tiatoolbox |
| 9 | + TOOLBOX_VER: 1.3.1 |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-and-push-image: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + fail-fast: true |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - dockerfile: ./docker/3.7/Debian/Dockerfile |
| 19 | + mtag: py3.7-debian |
| 20 | + - dockerfile: ./docker/3.8/Debian/Dockerfile |
| 21 | + mtag: py3.8-debian |
| 22 | + - dockerfile: ./docker/3.9/Debian/Dockerfile |
| 23 | + mtag: py3.9-debian |
| 24 | + - dockerfile: ./docker/3.9/Ubuntu/Dockerfile |
| 25 | + mtag: py3.9-ubuntu |
| 26 | + - dockerfile: ./docker/3.10/Debian/Dockerfile |
| 27 | + mtag: py3.10-debian |
| 28 | + - dockerfile: ./docker/3.10/Ubuntu/Dockerfile |
| 29 | + mtag: py3.10-ubuntu |
| 30 | + - dockerfile: ./docker/3.10/Ubuntu/Dockerfile |
| 31 | + mtag: latest |
| 32 | + permissions: |
| 33 | + contents: read |
| 34 | + packages: write |
| 35 | + id-token: write |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v3 |
| 40 | + |
| 41 | + - name: Log in to the Container registry |
| 42 | + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 |
| 43 | + with: |
| 44 | + registry: ${{ env.REGISTRY }} |
| 45 | + username: ${{ github.actor }} |
| 46 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + |
| 48 | + - name: Publishing with 'latest' tag |
| 49 | + if: contains(matrix.mtag, 'latest') |
| 50 | + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc |
| 51 | + with: |
| 52 | + context: . |
| 53 | + file: ${{ matrix.dockerfile }} |
| 54 | + push: true |
| 55 | + tags: "${{ env.image }}:${{ matrix.mtag }}" |
| 56 | + |
| 57 | + - name: Publishing with explicit tags |
| 58 | + if: ${{ !contains(matrix.mtag, 'latest') }} |
| 59 | + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc |
| 60 | + with: |
| 61 | + context: . |
| 62 | + file: ${{ matrix.dockerfile }} |
| 63 | + push: true |
| 64 | + tags: "${{ env.image }}:${{ env.TOOLBOX_VER }}-${{ matrix.mtag }}" |
0 commit comments