Skip to content

Move to .net 7 #79

Move to .net 7

Move to .net 7 #79

name: Build & Publish to DockerHub
on:
push:
branches: [ master ]
paths:
- 'dotnet-app/**'
- '.github/workflows/**'
- 'Dockerfile'
- '.dockerignore'
- '.gitignore'
release:
types: [ published ]
jobs:
build_and_publish:
name: Build an ASP.NET Core app and push it to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Build .NET Core App
run: dotnet publish dotnet-app/APIL/WordCounterBot.APIL.WebApi.csproj -r linux-arm64 -c Release -o ./app
- name: Log in to Docker Hub
uses: docker/#-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: admiralwoop/multi-purpose-tg-bot
tags: |
type=raw,value=latest
type=ref,event=branch,suffix=-{{sha}}
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}