This repository was archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (57 loc) · 2.13 KB
/
checkBuild.yml
File metadata and controls
70 lines (57 loc) · 2.13 KB
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
name: Check Build
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Install dependencies
run: dotnet restore
working-directory: src
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: src
- name: Test
run: dotnet test --no-restore --verbosity normal
working-directory: src
- name: Publish
run: dotnet publish -c Release -r alpine-x64 --self-contained -p:PublishSingleFile=true -p:DebugType=None -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=true
working-directory: src/PullDetachedRemote
- name: Upload built artifacts
uses: actions/upload-artifact@v3
with:
name: archive
path: |
src/PullDetachedRemote/bin/Release/net6.0/alpine-x64/publish/
if-no-files-found: error
- name: Copy Dockerfile into build output
run: cp build/Dockerfile src/PullDetachedRemote/bin/Release/net6.0/alpine-x64/publish/
- name: Generate tag vars
id: tagvars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "build_datetime=$(date -u +%Y%m%d-%H%M)" >> $GITHUB_OUTPUT
- name: Build Dockerimage and publish to Registry
# Let's call this Publish-... when it actually builds and publishes...
uses: elgohr/Publish-Docker-Github-Action@master
# Only run this on the develop Branch (push)
if: github.ref == 'refs/heads/develop'
with:
name: litetex/pulldetachedremote
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "develop,develop-${{ steps.tagvars.outputs.sha_short }}-${{ steps.tagvars.outputs.build_datetime }}"
workdir: src/PullDetachedRemote/bin/Release/net6.0/alpine-x64/publish/