-
-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (62 loc) · 2.19 KB
/
pr_check.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
name: PR Check
on:
workflow_dispatch:
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet: [ '6.0']
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Clean
run: dotnet clean src/AmbientWeatherLocalServer.sln --configuration Debug && dotnet nuget locals all --clear
- name: Restore
run: dotnet restore src/AmbientWeatherLocalServer.sln
- name: Build
run: dotnet build src/AmbientWeatherLocalServer.sln --no-restore --configuration Debug
- name: Test
run: dotnet test src/AmbientWeatherLocalServer.sln
create-test-image:
name: Publish Docker - PR
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PACKAGE_SECRET }}
- name: Prepare env
run: |
echo "BUILD_VERSION=${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ID}" >> $GITHUB_ENV
- name: Build & Push to Package Repositories
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
file: ./docker/Dockerfile
platforms: linux/arm64,linux/amd64
build-args: VERSION=${{ env.BUILD_VERSION }}
tags: |
${{ secrets.DOCKER_USERNAME }}/ambientweather-local-server:pr
ghcr.io/${{ github.repository_owner }}/ambientweather-local-server:pr
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}