-
Notifications
You must be signed in to change notification settings - Fork 132
47 lines (45 loc) · 1.12 KB
/
dotnet.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
name: build .NET 8
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
PUBLISH: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
version: latest
- uses: docker/login-action@v2
if: ${{ env.PUBLISH }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=sha
type=edge
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/build-push-action@v3
id: build
with:
file: Dockerfile
context: .
push: ${{ env.PUBLISH }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}