Finish working on the app and push for final deployement #18
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: CI/CD Pipeline | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "development" | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: 12345 | |
ports: ["5432:5432"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Run tests | |
env: | |
DATABASE_URL: postgres://postgres:12345@localhost:5432/test | |
RAILS_ENV : test | |
run: | | |
bin/rails test:prepare | |
bin/rails db:test:prepare | |
bin/rails test | |
- name: Deploy to Heroku | |
uses: akhileshns/heroku-deploy@v3.13.15 | |
with: | |
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | |
heroku_app_name: url-shortner-bese | |
heroku_email: besurye@gmail.com |