-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.28 KB
/
build-and-publish-image.yaml
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
name: Build and Publish
permissions:
contents: write
packages: write
on:
push:
branches: [ main ]
jobs:
buildandpublish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.x'
- name: Publish App
run: dotnet publish ./FundaScraper/FundaScraper.csproj -c Release -o ./publish
- name: Get XML Version in .csproj
id: getVersion
uses: mavrosxristoforos/[email protected]
with:
xml-file: 'FundaScraper/FundaScraper.csproj'
xpath: '/Project/PropertyGroup/Version'
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v3
with:
context: .
file: ./FundaScraper/Dockerfile
push: github.ref == 'refs/heads/main'
tags: |
ghcr.io/marcel0024/funda-scraper:${{ steps.getVersion.outputs.info }}
ghcr.io/marcel0024/funda-scraper:latest