1+ name : Publish Docker Image
12on :
23 push :
34 branches :
4- - main
5- paths :
6- - " .github/workflows/build-commit.yml"
7- - " src/**"
8- - " NotifierRedirecter.sln"
9- - " Dockerfile"
10-
11- env :
12- DOTNET_NOLOGO : 1
13- DOTNET_CLI_TELEMETRY_OPTOUT : 1
14- DOTNET_SKIP_FIRST_TIME_EXPERIENCE : 1
15- DOTNET_SYSTEM_GLOBALIZATION_INVARIANT : 1
5+ - master
6+ workflow_dispatch :
167
178jobs :
189 build-commit :
19- name : " Build Commit ${{ github.sha }} "
10+ name : Build Commit
2011 runs-on : ubuntu-latest
21- if : " !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
2212 steps :
2313 - name : Checkout
2414 uses : actions/checkout@v3
25- - name : Setup .NET
26- uses : actions/setup-dotnet@v3
15+ - name : Generate Date Tag
16+ run : echo "TAG=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
17+ - name : Set up QEMU
18+ uses : docker/setup-qemu-action@v1
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v1
21+ - name : Login to DockerHub
22+ uses : docker/login-action@v1
23+ with :
24+ registry : ghcr.io
25+ username : ${{ github.repository_owner }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+ - name : Build and Push
28+ uses : docker/build-push-action@v2
2729 with :
28- dotnet-version : 8
29- - name : Build Project
30- run : " dotnet build"
31- - name : Build Dockerfile
32- run : " docker build -t notifier-redirecter:latest ."
30+ context : .
31+ file : ./Dockerfile
32+ push : true
33+ build-args : VERSION=${{ env.TAG }}
34+ tags : |
35+ ghcr.io/kuylar/dspassistant:latest
36+ ghcr.io/kuylar/dspassistant:${{ env.TAG }}
0 commit comments