-
-
Notifications
You must be signed in to change notification settings - Fork 26
133 lines (126 loc) · 3.65 KB
/
publish-next.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Publish
on:
push:
branches: [ next ]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: ./.github/actions/codecheck
push:
runs-on: ubuntu-latest
needs:
- check
permissions:
contents: read
packages: write
environment:
name: next
url: https://next.vatsim-radar.com
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Add .env file
run: echo "${{ secrets.ENV }}" > .env
- name: Build and push
uses: docker/build-push-action@v5
with:
tags: ghcr.io/vatsim-radar/vatsim-radar/next:latest
context: .
push: true
file: .config/Dockerfile
deploy-app:
runs-on: ubuntu-latest
needs:
- push
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up kubectl
uses: matootie/[email protected]
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: main
- name: Deploy App
run: kubectl apply -f .config/k8s/next/app.yml
- name: Apply App
run: kubectl rollout restart deployment app-next
- name: Apply Worker
run: kubectl rollout restart deployment worker-next
- name: Validate App
run: kubectl rollout status deployment app-next
- name: Validate Worker
run: kubectl rollout status deployment worker-next
deploy-db-redis:
runs-on: ubuntu-latest
needs:
- push
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up kubectl
uses: matootie/[email protected]
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: main
- name: Deploy Volume
run: kubectl apply -f .config/k8s/next/volume.yml
- name: Deploy Redis
run: kubectl apply -f .config/k8s/next/redis.yml
- name: Validate Redis
run: kubectl rollout status deployment redis-next
- name: Deploy DB
run: kubectl apply -f .config/k8s/next/db.yml
- name: Validate DB
run: kubectl rollout status deployment db-next
deploy-ingress:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
- name: Set up kubectl
uses: matootie/[email protected]
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: main
- name: Deploy Ingress
run: kubectl apply -f .config/k8s/ingress.yml
github-release:
name: Release tag to Github
needs:
- deploy-app
- deploy-db-redis
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get Tag Name
id: tagName
uses: beaconbrigade/[email protected]
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Create Release
uses: softprops/action-gh-release@v2
with:
target_commitish: next
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.tagName.outputs.version }}
name: ${{ steps.release.outputs.title }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}
prerelease: true