From 4fa4fe3421e8acaa67826dd0d98861575e2e2cd0 Mon Sep 17 00:00:00 2001 From: "Seele.Clover" <37256067+seeleclover@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:34:15 +0800 Subject: [PATCH] set Docker CI of CUDA --- .github/workflows/docker-ci-cuda.yml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/docker-ci-cuda.yml diff --git a/.github/workflows/docker-ci-cuda.yml b/.github/workflows/docker-ci-cuda.yml new file mode 100644 index 0000000..69d80d1 --- /dev/null +++ b/.github/workflows/docker-ci-cuda.yml @@ -0,0 +1,61 @@ +name: Docker CI of CUDA + +on: + push: + tags: + - 'cuda-*' + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + env: + IMAGE_NAME: docker-images + + steps: + - name: Set Docker Image Name and Tag + id: system + run: | + TAG=${GITHUB_REF#refs/tags/} + IFS=- read -r IMAGE VERSION <<< $TAG + echo "image=$IMAGE" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and Push Image + uses: docker/build-push-action@v5 + with: + context: ./os/ + file: ./os/Dockerfile + platforms: | + linux/amd64 + push: true + build-args: | + SYSTEM_IMAGE=nvidia/cuda + SYSTEM_VERSION=${{ steps.system.outputs.version }} + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.system.outputs.image }}-${{ steps.system.outputs.version }} + + - name: Update repo description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + repository: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }} + short-description: ${{ github.event.repository.description }} + + - name: Push Summary + run: echo "### Build ${{ steps.system.outputs.image }}-${{ steps.system.outputs.version }} Successfully :rocket:" >> $GITHUB_STEP_SUMMARY