-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (37 loc) · 1.27 KB
/
cd.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
name: CD
on:
push:
branches:
- main
jobs:
migrate:
runs-on: ubuntu-latest
env:
DB_PORT: ${{ secrets.LIVRO_LIVRE_DB_PORT }}
DB_HOST: ${{ secrets.LIVRO_LIVRE_DB_HOST }}
DB_USER: ${{ secrets.LIVRO_LIVRE_DB_USER }}
DB_PASSWORD: ${{ secrets.LIVRO_LIVRE_DB_PASSWORD }}
DB_NAME: ${{ secrets.LIVRO_LIVRE_DB_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
npm install
- name: Run migrations
run: |
npm run migration:run
build:
needs: migrate
runs-on: ubuntu-latest # Setup an environment to run the action
steps:
- uses: actions/checkout@v2 # This actions copy the repository on the environment
- name: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- uses: akhileshns/heroku-deploy@v3.12.12 # This action deploys the content on Heroku
with:
heroku_api_key: ${{secrets.LIVRO_LIVRE_HEROKU_API_KEY}} #The Heroku api key we stored on our repo secret
heroku_app_name: "livro-livre-users" #The name of your heroku app - Must be unique in Heroku
heroku_email: "livrolivreeng@gmail.com" #Your heroku yuser name
usedocker: true