-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.6 KB
/
prod.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
54
55
56
57
58
59
60
61
62
63
64
name: Deploy .NET App to Local Kubespray Cluster
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --configuration Release --no-restore
- name: Test project
run: dotnet test --configuration Release --no-build
docker:
needs: build
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/yaup-api:${{ github.sha }} ./src/YetAnotherUnfinishedProject.API
docker push ${{ secrets.DOCKER_USERNAME }}/yaup-api:${{ github.sha }}
tailscale:
needs: build
runs-on: ubuntu-latest
environment: prod
steps:
- name: Connect to headscale network
uses: tailscale/github-action@v2
with:
authkey: ${{ secrets.HEADSCALE_API_KEY }}
tags: tag:ci
version: '1.66.3'
args: '--login-server=${{secrets.HEADSCALE_URL}} --user=${{secrets.HEADSCALE_USER}}'