chore: migrations #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
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 |