Update lighthouse-ci.yml #16
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: lighthouse-ci | |
on: | |
push: | |
branches: | |
- feature/lighthouse-ci | |
jobs: | |
lighthouseci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and start Docker containers | |
run: | | |
docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env --profile postgres up -d --build | |
- name: Health Check the Server http response | |
uses: jtalk/url-health-check-action@v4 | |
with: | |
url: http://localhost/api/v3/testConnection | |
max-attempts: 10 | |
retry-delay: 10s | |
- name: Setup and install Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm install | |
- name: Decode and save Google credentials to a file | |
run: | | |
echo "${{ secrets.GOOGLE_CREDENTIALS }}" | base64 --decode > ./googleCredentials.json | |
- name: Install required packages and run lighthouse audit (results to be uploaded to access issue log) | |
run: | | |
npm install axios tough-cookie axios-cookiejar-support lighthouse chrome-launcher googleapis | |
node lighthouseAudit.mjs --spreadsheetId="176knLyqkJ0vxFMH-qtWi9J17-oJ3-ChdLQkISd59oOY" | |
- name: Stop Docker containers | |
if: always() | |
run: docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env --profile postgres down |