Skip to content

Add container documentation and seeding rake tasks #146

Add container documentation and seeding rake tasks

Add container documentation and seeding rake tasks #146

Workflow file for this run

name: Lighthouse CI
on:
push:
branches: [master, develop]
pull_request:
branches: [master]
jobs:
lighthouse:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pwb_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pwb_test
DISABLE_SPRING: 1
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: |
npm ci
bundle exec rake db:create db:schema:load
- name: Build assets
run: |
npm run tailwind:build
bundle exec rake assets:precompile
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v12
with:
configPath: ./lighthouserc.js
uploadArtifacts: true
temporaryPublicStorage: true
- name: Format Lighthouse Score
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
script: |
const fs = require('fs');
const resultsPath = '.lighthouseci/links.json';
if (fs.existsSync(resultsPath)) {
const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8'));
const urls = Object.keys(results);
let comment = '## Lighthouse Results\n\n';
urls.forEach(url => {
comment += `- [${url}](${results[url]})\n`;
});
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
}