-
-
Notifications
You must be signed in to change notification settings - Fork 18
68 lines (57 loc) · 1.75 KB
/
deploy.yml
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
name: Deploy dim-api
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/deploy.yml'
- 'api/**'
- 'dim-gg-static/**'
- 'kubernetes/dim-api-deployment.yaml'
- 'kubernetes/deploy.sh'
- 'Dockerfile'
- '.babelrc'
- 'package.json'
- 'tsconfig.json'
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # So sentry can get the previous commit
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: pnpm install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{secrets.K8S_CLUSTER}}
- name: Build and deploy
run: pnpm run deploy
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: destiny-item-manager
SENTRY_PROJECT: dim-api
with:
environment: production
version: ${{ env.GITHUB_SHA }}
ignore_missing: true
- name: Verify deployment
run: kubectl rollout status deployment/dim-api