-
-
Notifications
You must be signed in to change notification settings - Fork 17
59 lines (50 loc) · 1.64 KB
/
branch-deploy.yml
File metadata and controls
59 lines (50 loc) · 1.64 KB
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
name: branch-deploy
on:
issue_comment:
types: [ created ]
# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
pull-requests: write
deployments: write
contents: write
checks: read
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@v8.0.0
with:
admins: the-hideout/core-contributors
admins_pat: ${{ secrets.BRANCH_DEPLOY_ADMINS_PAT }}
environment_targets: production
sticky_locks: "true"
- name: checkout
if: steps.branch-deploy.outputs.continue == 'true'
uses: actions/checkout@v4.1.0
with:
ref: ${{ steps.branch-deploy.outputs.ref }}
- uses: actions/setup-node@v3.8.1
if: steps.branch-deploy.outputs.continue == 'true'
with:
node-version-file: .node-version
cache: 'npm'
- 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 }}