-
-
Notifications
You must be signed in to change notification settings - Fork 641
85 lines (75 loc) · 2.72 KB
/
deploy-prod.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Deploy Prod
on:
workflow_dispatch:
inputs:
patch:
description: 'Should this be a patch release?'
type: boolean
required: true
default: true
schedule:
# Deploy at 5pm Sunday PST, which is 1am Monday UTC
# * is a special character in YAML so you have to quote this string
- cron: '0 1 * * 1'
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: release
url: https://app.dim.gg
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # So sentry can get the previous commit
# Use the dim-release-bot token rather than the default
token: ${{ secrets.GH_TOKEN }}
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: Install SSH key
uses: benoitchantre/[email protected]
with:
private-key: ${{ secrets.SSH_KEY }}
private-key-name: dim.rsa
known-hosts: ${{ secrets.REMOTE_HOST }}
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build and deploy
run: ./build/deploy-prod.sh
env:
PATCH: ${{ github.event.inputs.patch }}
NODE_OPTIONS: "--max_old_space_size=8192"
WEB_API_KEY: ${{ secrets.BUNGIE_API_KEY }}
WEB_OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
WEB_OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_SECRET }}
DIM_API_KEY: ${{ secrets.DIM_API_KEY }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_PATH: app.destinyitemmanager.com
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# Use the dim-release-bot token rather than the default
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Purge CloudFlare cache
run: ./build/purge-cloudflare.sh
env:
CLOUDFLARE_KEY: ${{ secrets.CLOUDFLARE_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
APP_DOMAIN: app.destinyitemmanager.com
- name: get-npm-version
id: package-version
shell: bash
run: |
echo "current-version=$(node -p 'const pkg = require("./web-console/package.json"); pkg.version')" >> $GITHUB_OUTPUT
- 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
with:
environment: release
version: ${{ steps.package-version.outputs.current-version }}
ignore_missing: true