From 684507f86772a18729a6da1071db1e3342a34518 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Sun, 27 Oct 2024 09:23:30 -0600 Subject: [PATCH] Update build_CPU.yml to add version to dockerhub --- .github/workflows/build_CPU.yml | 36 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_CPU.yml b/.github/workflows/build_CPU.yml index a588164..8b90ecb 100644 --- a/.github/workflows/build_CPU.yml +++ b/.github/workflows/build_CPU.yml @@ -2,18 +2,12 @@ name: Build_Subgen_Dockerfile_CPU on: push: - # branches: - # - 'main' - # paths-ignore: - # - '**.md' - # - '**.yml' - paths: + paths: - 'requirements.txt' - 'Dockerfile.cpu' workflow_dispatch: jobs: - docker: runs-on: ubuntu-latest strategy: @@ -22,24 +16,38 @@ jobs: platform: - linux/amd64 - linux/arm64 + steps: - name: Checkout uses: actions/checkout@v4 + + - name: Set Calver Version + uses: Nelyx/action-calver@v1.0.0 + id: setcalver + with: + default_branch: 'refs/heads/main' + format: 'YYYY.M.D' + version_prefix: '' + - 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.0.0 + + - name: Login to Docker Hub + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push CPU + + - name: Build and push CPU Docker image uses: docker/build-push-action@v5 with: - platforms: linux/amd64, linux/arm64 + context: . + platforms: linux/amd64,linux/arm64 file: ./Dockerfile.cpu push: true - tags: mccloud/subgen:cpu + tags: | + mccloud/subgen:cpu + mccloud/subgen:${{ steps.setcalver.outputs.package_version }}-cpu