99 build-and-push :
1010 runs-on : ubuntu-latest
1111 strategy :
12- # If any matrix job fails, cancel all others immediately.
1312 fail-fast : true
1413 matrix :
15- # Defines the different configurations to build.
16- # This will generate 16 parallel jobs (2 * 2 * 2 * 2).
1714 dockerfile : ["Dockerfile.cuda", "Dockerfile.common"]
1815 install_llvm : [true, false]
1916 install_rust : [true, false]
@@ -32,27 +29,25 @@ jobs:
3229 swap-storage : true
3330
3431 - name : Checkout repository
35- uses : actions/checkout@v4 # Using the latest version
32+ uses : actions/checkout@v4
3633
3734 - name : Set up Docker Buildx
38- uses : docker/setup-buildx-action@v3 # Using the latest version
35+ uses : docker/setup-buildx-action@v3
3936
4037 - name : Login to Docker Hub
41- uses : docker/login-action@v3 # Using the latest version
38+ uses : docker/login-action@v3
4239 with :
4340 username : ${{ secrets.DOCKERHUB_USERNAME }}
4441 password : ${{ secrets.DOCKERHUB_TOKEN }}
4542
4643 - name : Build Docker image
4744 env :
48- # Set environment variables for the build script from the matrix
4945 INSTALL_LLVM : ${{ matrix.install_llvm }}
5046 INSTALL_RUST : ${{ matrix.install_rust }}
5147 INSTALL_TORCH : ${{ matrix.install_torch }}
52- # Pass the correct Dockerfile name from the matrix to the build script
53- run : bash ./scripts/build.sh "${{ matrix.dockerfile }}"
48+ run : |
49+ bash ./scripts/build.sh "${{ matrix.dockerfile }}"
50+ echo "IMAGE_NAME=$(bash ./scripts/get_image_name.sh)" >> $GITHUB_ENV
5451
55- - name : Push Docker image(s)
56- # This assumes push.sh can discover and push the image(s) created
57- # in the previous step without explicit arguments.
58- run : bash ./scripts/push.sh
52+ - name : Push Docker image
53+ run : bash ./scripts/push.sh "${{ env.IMAGE_NAME }}"
0 commit comments