-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (43 loc) · 1.42 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
name: Deploy
on:
push:
branches:
- production
- staging
jobs:
# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version-file: .nvmrc
# cache: npm
# - name: Install dependencies
# run: npm ci
# - name: Run tests
# run: npm test
deploy:
name: Deploy
# needs: test
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
url: ${{ github.ref_name == 'production' && 'https://jinglebot.v4.wtf/invite' || 'https://jinglebot-staging.v4.wtf/invite' }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Publish to ${{ github.ref_name }}
run: npm run publish:${{ github.ref_name }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
DISCORD_CLIENT_ID: ${{ github.ref_name == 'production' && secrets.PRODUCTION_DISCORD_CLIENT_ID || secrets.STAGING_DISCORD_CLIENT_ID }}
DISCORD_CLIENT_SECRET: ${{ github.ref_name == 'production' && secrets.PRODUCTION_DISCORD_CLIENT_SECRET || secrets.STAGING_DISCORD_CLIENT_SECRET }}