Skip to content

Commit

Permalink
build and publish container image
Browse files Browse the repository at this point in the history
  • Loading branch information
anmalkov committed Dec 7, 2023
1 parent 9a022d0 commit bf792ea
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,40 @@ 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>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<FileVersion>$VERSION<\/FileVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<AssemblyVersion>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Ui/Crisp.Ui.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<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

0 comments on commit bf792ea

Please sign in to comment.