generated from codebytes/marp-slides-template
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.28 KB
/
dotnet-docker.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
name: Dotnet Publish to ACR
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE_NAME: 'sampleapi'
TAG: ${{ github.sha }}
steps:
- uses: actions/checkout@v3
- name: Set up dependency caching for faster builds
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ vars.DOCKER_LOGIN_SERVER }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_LOGIN_SERVER }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build with dotnet
run: |
dotnet publish -c Release -t:PublishContainer \
-p ContainerRepository=${{ env.IMAGE_NAME }} \
-p ContainerRegistry=${{ vars.DOCKER_LOGIN_SERVER }} \
-p ContainerImageTags='"${{ env.TAG }};latest"'
working-directory: src/SampleApi