From bf792ea7965727c9653991fcc24772faa0d326d2 Mon Sep 17 00:00:00 2001 From: Andrew Malkov Date: Thu, 7 Dec 2023 17:56:27 +0100 Subject: [PATCH] build and publish container image --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00aa149..0792ae2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,8 @@ jobs: - name: Set version from tag run: | TAG_NAME=$(echo $GITHUB_REF | cut -d '/' -f 3) - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV VERSION=${TAG_NAME#v} + echo "TAG_VERSION=$VERSION" >> $GITHUB_ENV echo "Updating project version to $VERSION" sed -i "s/.*<\/AssemblyVersion>/$VERSION<\/AssemblyVersion>/g" Crisp.Core/Crisp.Core.csproj sed -i "s/.*<\/FileVersion>/$VERSION<\/FileVersion>/g" Crisp.Core/Crisp.Core.csproj @@ -33,10 +33,31 @@ jobs: sed -i "s/.*<\/FileVersion>/$VERSION<\/FileVersion>/g" Crisp.Ui/Crisp.Ui.csproj working-directory: src - - name: Restore dependencies - run: dotnet restore - working-directory: src/Crisp.Core + # - name: Restore dependencies + # run: dotnet restore + # working-directory: src/Crisp.Core - - name: Build application - run: dotnet build --configuration Release --no-restore - working-directory: src/Crisp.Core + # - name: Build application + # run: dotnet build --configuration Release --no-restore + # working-directory: src/Crisp.Core + + - 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.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: src + push: true + tags: | + anmalkov/crisp:$TAG_VERSION + anmalkov/crisp:latest