-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (79 loc) · 2.85 KB
/
build-and-publish.yaml
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
name: Bog-API-Build
on: [push]
jobs:
build_nuget:
name: Build Application
runs-on: ubuntu-latest
steps:
- name: setup-dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: setup-nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: 'latest'
- name: checkout-repo
uses: actions/checkout@v2
with:
clean: 'true'
- name: echo-things
run: echo '${{github.workspace}} - ${{github.run_id}} - ${{github.run_number}}'
- name: setup-nuget-source
run: nuget sources add -Name "github" -Source "https://nuget.pkg.github.com/pirahawk/index.json" -username "pirahawk" -password "${{secrets.GITHUB_TOKEN}}" -StorePasswordInClearText -configfile ./nuget.config
- name: build-dotnet
run: dotnet build --nologo
- name: pack-nuget-packages-master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: dotnet pack -o ./nugetPublish --nologo /p:version=1.0.${{github.run_number}}
- name: pack-nuget-packages-pre-release
if: github.event_name == 'push' && github.ref != 'refs/heads/master'
run: dotnet pack -o ./nugetPublish --nologo /p:version=1.0.${{github.run_number}}-alpha
- name: push-common-nuget-to-package-store
run: dotnet nuget push ./nugetPublish/*Common.[1-9]*.nupkg -s 'github'
- name: push-domain-nuget-to-package-store
run: dotnet nuget push ./nugetPublish/*Domain.[1-9]*.nupkg -s 'github'
- name: print-directory
run: ls -la ./nugetPublish
run_tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: setup-dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: checkout-repo
uses: actions/checkout@v2
with:
clean: 'true'
- name: run-tests
run: dotnet test --nologo
build_docker:
name: Publish docker image
needs: [build_nuget, run_tests]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: checkout-repo
uses: actions/checkout@v2
with:
clean: 'true'
# These do not currently work for me, commenting out till I understand them more
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- name: docker-login
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker-push
uses: docker/build-push-action@v2
with:
push: true
tags: |
docker.pkg.github.com/${{ github.repository }}/bogapi:${{github.run_number}}
docker.pkg.github.com/${{ github.repository }}/bogapi:latest