Bump actions/upload-artifact from 3 to 4 #2562
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: | |
push: | |
jobs: | |
qa: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
image: postgres:13.3-alpine | |
ports: ["5432:5432"] | |
redis: | |
image: redis:6.2.5-alpine | |
ports: [ "6379:6379" ] | |
env: | |
BUNDLE_JOBS: 4 | |
BUNDLE_RETRY: 3 | |
BUNDLE_PATH: vendor/bundle | |
steps: | |
- name: Increase max fs watches | |
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
- name: Cache Ruby Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gem-v1-${{ hashFiles('Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gem-v1 | |
- name: Setup | |
run: bin/setup | |
- name: Run linters | |
run: | | |
bin/qa | |
- name: Test assets compilation | |
run: RAILS_ENV=test bin/rails assets:precompile | |
- name: Run unit tests | |
run: bin/rails test | |
- name: Run E2E tests | |
run: bin/rails test:system | |
- name: Publish code coverage | |
uses: paambaati/codeclimate-action@v5.0.0 | |
continue-on-error: true | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
- name: Upload failed tests screenshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: system-tests-screenshots | |
path: tmp/screenshots/**/*.png | |
- name: Upload Rails logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: logs | |
path: log/**/*.log | |
deploy: | |
needs: qa | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: deploy | |
name: Deploy to dokku | |
continue-on-error: true | |
uses: idoberko2/dokku-deploy-github-action@v1 | |
with: | |
ssh-private-key: ${{ secrets.DOKKU_SSH_KEY }} | |
dokku-host: ${{ secrets.DOKKU_HOST }} | |
app-name: 'malheatmap' | |
git-push-flags: --force | |
remote-branch: main |