Skip to content

Commit 6c7f383

Browse files
authored
Update docker-publish.yml
1 parent bfc77b6 commit 6c7f383

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/docker-publish.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ env:
1515
# Use docker.io for Docker Hub if empty
1616
REGISTRY: docker.io
1717
# github.repository as <account>/<repo>
18-
IMAGE_NAME: nanobits/python-cuda
18+
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/python-cuda
1919

2020

2121
jobs:
2222
build:
2323
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python: [3.9]
27+
cuda: [11.8.0]
28+
cudnn: [8]
29+
ubuntu: [22.04]
2430
permissions:
2531
contents: read
2632
packages: write
@@ -57,11 +63,11 @@ jobs:
5763

5864
# Extract metadata (tags, labels) for Docker
5965
# https://github.com/docker/metadata-action
60-
# - name: Extract Docker metadata
61-
# id: meta
62-
# uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
63-
# with:
64-
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
66+
- name: Extract Docker metadata
67+
id: meta
68+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
69+
with:
70+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6571

6672
# Build and push Docker image with Buildx (don't push on PR)
6773
# https://github.com/docker/build-push-action
@@ -71,10 +77,15 @@ jobs:
7177
with:
7278
context: .
7379
push: ${{ github.event_name != 'pull_request' }}
74-
tags: latest #${{ steps.meta.outputs.tags }}
80+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:py${{ matrix.python }}-cuda${{ matrix.cuda }}-cudnn${{ matrix.cudnn }}-ubuntu${{ matrix.ubuntu }} #${{ steps.meta.outputs.tags }}
7581
labels: ${{ steps.meta.outputs.labels }}
7682
cache-from: type=gha
7783
cache-to: type=gha,mode=max
84+
build-args: |
85+
PYTHON_VERSION=${{ matrix.python }}
86+
CUDA_VERSION=${{ matrix.cuda }}
87+
CUDNN_VERSION=${{ matrix.cudnn }}
88+
UBUNTU_VERSION=${{ matrix.ubuntu }}
7889
7990
8091
# Sign the resulting Docker image digest except on PRs.
@@ -88,4 +99,4 @@ jobs:
8899
COSIGN_EXPERIMENTAL: "true"
89100
# This step uses the identity token to provision an ephemeral certificate
90101
# against the sigstore community Fulcio instance.
91-
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
102+
run: echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:py${{ matrix.python }}-cuda${{ matrix.cuda }}-cudnn${{ matrix.cudnn }}-ubuntu${{ matrix.ubuntu }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

0 commit comments

Comments
 (0)