generated from Archit404Error/MERN-webapp
-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (35 loc) · 1.14 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
# Your workflow name.
name: Deploy to heroku.
# Run workflow on every push to master branch.
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js environment to run migrations
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies and run migrations
working-directory: backend/
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
yarn install
npx prisma migrate deploy
- name: Build, Push and Release a Docker container to Heroku.
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
uses: gonuit/heroku-docker-deploy@v1.3.3
with:
email: ${{ secrets.HEROKU_EMAIL }}
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
dockerfile_directory: backend/
dockerfile_name: Dockerfile.deploy
docker_options: "--platform linux/amd64 --env-file <(echo '$ENV_FILE')"
process_type: web