This commit is contained in:
@@ -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 }}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user