-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (69 loc) · 1.92 KB
/
ci.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
name: CI
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
app:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- run: yarn
# - run: yarn lint
# - run: yarn test
api:
runs-on: ubuntu-latest
defaults:
run:
working-directory: api
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: go mod download
- run: go test
deploy:
runs-on: ubuntu-latest
needs: [app, api]
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
environment: hdweeklyleague.com
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: api
push: true
tags: hdstmevents/api:latest
- name: Build and push
uses: docker/build-push-action@v5
with:
context: app
push: true
tags: hdstmevents/app:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Helm Upgrade
shell: bash
run: |
doctl kubernetes cluster kubeconfig save --expiry-seconds 240 ${{ secrets.DIGITALOCEAN_CLUSTER_NAME }}
helm dependency update ./helm/hds-tm-events
helm -n hds-tm-events upgrade --install --wait --timeout 60s --atomic hds-tm-events ./helm/hds-tm-events/