-
Notifications
You must be signed in to change notification settings - Fork 6
104 lines (90 loc) · 3.14 KB
/
docker-publish.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Docker
on:
push:
tags:
- v*
pull_request:
env:
IMAGE_NAME: OpenAlprWebhookProcessor
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file ./OpenAlprWebhookProcessor/Dockerfile
fi
windows-build-push:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Check out the repo
uses: actions/checkout@main
- name: Setup Buildx
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
include-prerelease: true
- name: Build Artifact
run: |
tag=$(git describe --tags --abbrev=0)
release_name="OpenAlprWebHookProcessor-${tag}-windows64"
dotnet restore "OpenAlprWebhookProcessor/OpenAlprWebhookProcessor.csproj"
dotnet build "OpenAlprWebhookProcessor/OpenAlprWebhookProcessor.csproj" -c Release
dotnet publish "OpenAlprWebhookProcessor/OpenAlprWebhookProcessor.csproj" -c Release -o "$release_name"
tar czvf "${release_name}.tar.gz" "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
if: contains(github.ref, 'alpha') != true
with:
files: "OpenAlprWebHookProcessor*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
uses: softprops/action-gh-release@v1
if: contains(github.ref, 'alpha')
with:
files: "OpenAlprWebHookProcessor*"
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-build-push:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Get git tag
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Push to Docker Hub
if: contains(github.ref, 'alpha') != true
uses: docker/build-push-action@v2
with:
file: ./OpenAlprWebhookProcessor/Dockerfile
push: true
tags: |
mlapaglia/openalprwebhookprocessor:${{ steps.get_version.outputs.VERSION }}
mlapaglia/openalprwebhookprocessor:latest
- name: Push alpha build to Docker Hub
if: contains(github.ref, 'alpha')
uses: docker/build-push-action@v2
with:
file: ./OpenAlprWebhookProcessor/Dockerfile
push: true
tags: |
mlapaglia/openalprwebhookprocessor:${{ steps.get_version.outputs.VERSION }}