-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (66 loc) · 1.87 KB
/
on-dev.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
name: Push image on dev
on:
push:
branches: [dev]
workflow_dispatch:
jobs:
build_and_test:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration $env:Configuration --no-restore
env:
Configuration: ${{ matrix.configuration }}
- name: Test
run: dotnet test --configuration $env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-debug
path: |
CSharp-OpenBMCLAPI/bin/Release
push_to_registry:
name: Push Docker image to Docker Hub
if: true
runs-on: ubuntu-latest
needs:
- build_and_test
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set environment
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: saltwood233/csharp-openbmclapi
- name: Build and push Docker image
id: push
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
push: true
tags: saltwood233/csharp-openbmclapi:dev