-
Notifications
You must be signed in to change notification settings - Fork 12
46 lines (38 loc) · 1.29 KB
/
backend-production-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
name: Deploy backend to production
on:
release:
types: [released]
jobs:
reset-release-branch:
name: Update release branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch history for all branches and tags
token: ${{ secrets.GH_TOKEN }} # use PAT with permissions to push to master
ref: release
- name: Perform reset
run: |
git reset --hard ${{ github.ref }}
git push --force origin release
production-deploy:
name: Deploy to Heroku
runs-on: ubuntu-latest
needs: reset-release-branch
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch history for all branches and tags
ref: release
- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh
- name: Install builds plugin
run: heroku plugins:install heroku-builds
- name: Build app into tarball
run: python setup.py sdist --formats=gztar
- name: Create Heroku Build
run: heroku builds:create -a dandi-api --source-tar=dist/$(python setup.py --fullname).tar.gz
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}