-
-
Notifications
You must be signed in to change notification settings - Fork 13
62 lines (53 loc) · 1.89 KB
/
branch-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
name: branch-deploy
on:
issue_comment:
types: [ created ]
permissions:
pull-requests: write
deployments: write
contents: write
jobs:
deploy:
name: deploy
if: ${{ github.event.issue.pull_request }} # only run on pull request comments
runs-on: ubuntu-latest
environment: production-secrets
steps:
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@e01d5aa54a277a8f36d6954c5ed5a29e35d27097 # pin@v2.2.0
with:
admins: the-hideout/core-contributors
admins_pat: ${{ secrets.BRANCH_DEPLOY_ADMINS_PAT }}
- name: Checkout
if: steps.branch-deploy.outputs.continue == 'true'
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
with:
ref: ${{ steps.branch-deploy.outputs.ref }}
- name: Cache node modules
if: steps.branch-deploy.outputs.continue == 'true'
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # pin@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
if: steps.branch-deploy.outputs.continue == 'true'
run: npm install
- name: Register Slash Commands
if: steps.branch-deploy.outputs.continue == 'true'
env:
NODE_ENV: ci
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
run: node deploy-commands.mjs
- name: Deploy to Railway
if: steps.branch-deploy.outputs.continue == 'true'
run: npm run deploy
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}