build.yml 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. name: Deploy
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. deploy:
  8. name: Deploy to Heroku
  9. runs-on: ubuntu-24.04
  10. if: github.repository == 'freeCodeCamp/devdocs'
  11. steps:
  12. - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
  13. - name: Set up Ruby
  14. uses: ruby/setup-ruby@a4f838919020b587bb8dd4493e8881bb113d3be7 # v1.246.0
  15. with:
  16. bundler-cache: true # runs 'bundle install' and caches installed gems automatically
  17. - name: Run tests
  18. run: bundle exec rake
  19. - name: Install Heroku CLI
  20. run: |
  21. curl https://cli-assets.heroku.com/install.sh | sh
  22. - name: Deploy to Heroku
  23. uses: akhileshns/heroku-deploy@e3eb99d45a8e2ec5dca08735e089607befa4bf28 # v3.14.15
  24. with:
  25. heroku_api_key: ${{secrets.HEROKU_API_KEY}}
  26. heroku_app_name: "devdocs"
  27. heroku_email: "team@freecodecamp.com"
  28. dontuseforce: true # --force should never be necessary
  29. dontautocreate: true # The app exists, it should not be created