Consistent checkout action versions #1702
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 | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16 | |
env: | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432/tcp | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
node-version-file: '.tool-versions' | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Test | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/support_act_test | |
# mirror .env | |
SENDER: [email protected] | |
LAST_FM_API_KEY: testing_key | |
LAST_FM_API_SECRET: testing_secret | |
run: | | |
./bin/bootstrap | |
./bin/rake | |
./bin/bundle exec rubocop | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: akhileshns/[email protected] | |
with: | |
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | |
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | |
heroku_email: ${{ secrets.HEROKU_EMAIL }} |