-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (64 loc) · 2.97 KB
/
publish-worker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Publish Worker
on:
release:
types: [ published ]
permissions:
packages: read
jobs:
docker-linux:
runs-on: ubuntu-latest
env:
IMAGE_NAME: dragonfruitdotnet/onionfruit-web:worker-linux-${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup GitHub NuGet
run: dotnet nuget update source github --username USERNAME --password ${{ github.token }} --store-password-in-clear-text
- name: Build Worker
run: dotnet publish -c Release -p:UseAppHost=false -p:Version=${{ github.event.release.tag_name }} DragonFruit.OnionFruit.Web.Worker
- name: Docker Build and Push
uses: docker/build-push-action@v5
with:
context: DragonFruit.OnionFruit.Web.Worker/bin/Release/net7.0/publish
file: DragonFruit.OnionFruit.Web.Worker/Dockerfile
platforms: linux/arm64,linux/amd64
tags: ${{ env.IMAGE_NAME }}
push: true
docker-windows:
runs-on: windows-latest
env:
IMAGE_NAME: dragonfruitdotnet/onionfruit-web:worker-windows-${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup GitHub NuGet
run: dotnet nuget update source github --username USERNAME --password ${{ github.token }} --store-password-in-clear-text
- name: Build Worker
run: dotnet publish -c Release -p:UseAppHost=false -p:Version=${{ github.event.release.tag_name }} DragonFruit.OnionFruit.Web.Worker
- name: Docker Build
run: docker build -f DragonFruit.OnionFruit.Web.Worker\Dockerfile -t ${{ env.IMAGE_NAME }} --build-arg "IMAGE_VARIANT=7.0-nanoserver-ltsc2022" DragonFruit.OnionFruit.Web.Worker\bin\Release\net7.0\publish
- name: Docker Push
run: docker push ${{ env.IMAGE_NAME }}
docker-multiarch-image:
runs-on: ubuntu-latest
needs:
- docker-linux
- docker-windows
steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create MultiArch+MultiOS Manifest
run: docker buildx imagetools create -t dragonfruitdotnet/onionfruit-web:worker -t dragonfruitdotnet/onionfruit-web:worker-${{ github.event.release.tag_name }} dragonfruitdotnet/onionfruit-web:worker-windows-${{ github.event.release.tag_name }} dragonfruitdotnet/onionfruit-web:worker-linux-${{ github.event.release.tag_name }}