-
-
Notifications
You must be signed in to change notification settings - Fork 13
61 lines (52 loc) · 1.93 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
name: branch-deploy
on:
issue_comment:
types: [ created ]
permissions:
pull-requests: write
deployments: write
contents: 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: GrantBirki/branch-deploy@5d7ea46552d858242fa4bf16625e9f29b1ee1b63 # pin@v1.4.2
- 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 Heroku
if: steps.branch-deploy.outputs.continue == 'true'
uses: AkhileshNS/heroku-deploy@79ef2ae4ff9b897010907016b268fd0f88561820 # pin@v3.12.12
with:
heroku_app_name: stash-eft
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}