Advertisement
Guest User

heroku_test_and_deploy.yaml

a guest
Oct 14th, 2022
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. name: Test and Deploy
  2. on:
  3. push:
  4. branches:
  5. - main
  6.  
  7. jobs:
  8. initialisation:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: say hello
  12. run: echo "Successfully started up GitHub Actions CI/CD Pipeline"
  13. test:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Clone and checkout our repo
  17. uses: actions/checkout@v2
  18. - name: setup node
  19. uses: actions/setup-node@v3
  20. - name: setup postgresql
  21. uses: harmon758/postgresql-action@v1
  22. with:
  23. postgresql db: nc_news
  24. postgresql user: news_user
  25. postgresql password: ncnews123
  26. - name: install dependencies
  27. run: npm i
  28. - name: run tests
  29. run: PGDATABASE=nc_news PGUSER=news_user PGPASSWORD=sbEj!oN5Gd@eB7re
  30.  
  31. deploy:
  32. runs-on: ubuntu-latest
  33. needs: test
  34. steps:
  35. - name: Clone and checkout repo
  36. uses: actions/checkout@v3
  37. - name: Deploy to Heroku
  38. uses: akhileshns/heroku-deploy@v3.12.12
  39. with:
  40. heroku_api_key: ${{secrets.HEROKU_API_KEY}}
  41. heroku_app_name: ${{secrets.APP_NAME}}
  42. heroku_email: ${{secrets.HEROKU_EMAIL}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement