Skip to content

Merge pull request #2778 from freeCodeCamp/renovate/github-actions #140

Merge pull request #2778 from freeCodeCamp/renovate/github-actions

Merge pull request #2778 from freeCodeCamp/renovate/github-actions #140

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
# A deploy only ever ships the tip of main, so a run that a newer push has
# already superseded is of no use.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy to Heroku
runs-on: ubuntu-26.04
if: github.repository == 'freeCodeCamp/devdocs'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Heroku rejects shallow pushes
- name: Install libwebp tools
run: sudo apt-get update && sudo apt-get install -y webp
- name: Set up Ruby
uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake
- name: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- name: Deploy to Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: |
heroku --version
heroku stack:set heroku-26 --app devdocs
# `rake assets:precompile` needs the cwebp of the Aptfile, which the
# apt buildpack puts on the PATH of the ones that follow it.
heroku buildpacks:clear --app devdocs
heroku buildpacks:add heroku-community/apt --app devdocs
heroku buildpacks:add heroku/ruby --app devdocs
heroku git:remote --app devdocs
# no --force; --force should never be necessary
git push heroku HEAD:main