From 75b99aa9d81e6938666092f24e5a7a3c9e44e1dc Mon Sep 17 00:00:00 2001 From: Tobias Maier Date: Thu, 6 Feb 2025 22:13:56 +0000 Subject: [PATCH] Test new --- .gitea/workflows/build_docker.yaml | 33 +++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build_docker.yaml b/.gitea/workflows/build_docker.yaml index fc3fa83..93a3876 100644 --- a/.gitea/workflows/build_docker.yaml +++ b/.gitea/workflows/build_docker.yaml @@ -41,21 +41,34 @@ jobs: username: tobimai password: ${{ secrets.docker_registry_key }} - name: Extract Version from Cargo.toml - id: cargo_version run: | - VERSION=$(grep '^version' Cargo.toml | head -n 1 | cut -d ' ' -f 3 | tr -d '"') - echo "VERSION=$VERSION" >> $GITEA_ENV - - name: Extract Version from Cargo.toml - id: Extract version from cargo.toml - run: | - VERSION=$(grep '^version' Cargo.toml | head -n 1 | cut -d ' ' -f 3 | tr -d '"') - echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: Build and Push Docker Image + VERSION_PATCH=$(grep '^version' Cargo.toml | head -n 1 | cut -d ' ' -f 3 | tr -d '"') + VERSION_MINOR=$(grep '^version' Cargo.toml | head -n 1 | cut -d ' ' -f 3 | tr -d '"' | cut -d '.' -f 1,2) + VERSION_MAJOR=$(grep '^version' Cargo.toml | head -n 1 | cut -d ' ' -f 3 | tr -d '"' | cut -d '.' -f 1,2) + echo "VERSION_PATCH=$VERSION_PATCH" >> $GITEA_ENV + echo "VERSION_MINOR=$VERSION_MINOR" >> $GITEA_ENV + echo "VERSION_MAJOR=$VERSION_MAJOR" >> $GITEA_ENV + echo "Patch Version: $VERSION_PATCH" + echo "Minor Version: $VERSION_MINOR" + echo "Major Version: $VERSION_MAJOR" + - name: Build and Push Docker Image for Patch version uses: docker/build-push-action@v2 with: context: . push: true - tags: gitea.maiertobi.de/tobimai/iot:${{ env.VERSION }} + tags: gitea.maiertobi.de/tobimai/iot:${{ env.VERSION_PATCH }} + - name: Build and Push Docker Image for minor version + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: gitea.maiertobi.de/tobimai/iot:${{ env.VERSION_MINOR }} + - name: Build and Push Docker Image for major version + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: gitea.maiertobi.de/tobimai/iot:${{ env.VERSION_MAJOR }}