-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 2.2 KB
/
Copy pathmapdoon-deploy.yaml
File metadata and controls
87 lines (73 loc) · 2.2 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Mapdoon Deploy Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '7.0.113'
- name: Build the project
run: dotnet build --configuration Release
working-directory: Src/
test:
needs: [build]
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: mapdoon@Test1
ACCEPT_EULA: 'Y'
ports:
- 1433:1433
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '7.0.113'
- name: Test with dotnet test
run: dotnet test --configuration Release Tests/Mapdoon.Application.Tests
deploy:
needs: [build,test]
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
ghcr.io/sharyash81/appdoon
- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ./Src
push: true
tags: ${{ steps.meta.outputs.tags }}-${{ vars.TAG }}
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Auto Increment tag
env:
PAT_TOKEN: ${{ secrets.PAT }}
run: |
new_tag=$((${{ vars.TAG}}+1))
echo $new_tag
echo $PAT_TOKEN > token.txt
gh auth login --with-token < token.txt
gh variable set TAG --body "$new_tag"