Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

build(deps-dev): bump @types/react from 18.0.17 to 18.2.37 #400

build(deps-dev): bump @types/react from 18.0.17 to 18.2.37

build(deps-dev): bump @types/react from 18.0.17 to 18.2.37 #400

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_DEVELOPMENT: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
BUILD_PRODUCTION: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
NETLIFY_SITE_NAME: xdisplacement
NETLIFY_DEVELOPMENT_DEPLOY_ID: ${{ github.sha }}
jobs:
web:
name: Web
runs-on: ubuntu-latest
env:
NEXT_CI_BUILD: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
cache-dependency-path: ./package-lock.json
- name: Install dependencies
run: npm ci
- name: Unit tests
run: npm run test:units
- name: Validate types
run: npm run test:types
- name: Code linting
run: npm run test:lint
- name: Build application
run: npm run build
- uses: actions/upload-artifact@v3
with:
name: output
path: ./out
deploy:
name: Deploy
needs: [web]
runs-on: ubuntu-latest
defaults:
run:
working-directory: netlify
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
cache-dependency-path: ./netlify/package-lock.json
- uses: actions/download-artifact@v3
with:
name: output
path: ./netlify/out
- name: Show "out" directory contents
run: find ./out | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
- name: Install dependencies for Netlify CLI
run: npm ci
- name: Deploy (Development)
if: ${{ env.BUILD_DEVELOPMENT == 'true' }}
run: npx netlify deploy --dir=out --alias ${{ env.NETLIFY_DEVELOPMENT_DEPLOY_ID }}
- name: Deploy (Production)
if: ${{ env.BUILD_PRODUCTION == 'true' }}
run: npx netlify deploy --dir=out --prod
lighthouse:
name: Lighthouse
needs: [deploy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir ./lighthouse-artifacts
- name: Lighthouse (Development)
if: ${{ env.BUILD_DEVELOPMENT == 'true' }}
uses: foo-software/[email protected]
with:
# https://www.foo.software/docs/lighthouse-check-github-action/configuration
urls: 'https://${{ env.NETLIFY_DEVELOPMENT_DEPLOY_ID }}--${{ env.NETLIFY_SITE_NAME }}.netlify.app'
outputDirectory: ./lighthouse-artifacts
device: 'all'
gitHubAccessToken: ${{ github.token }}
prCommentEnabled: true
prCommentSaveOld: true
- name: Lighthouse (Production)
if: ${{ env.BUILD_PRODUCTION == 'true' }}
uses: foo-software/[email protected]
with:
# https://www.foo.software/docs/lighthouse-check-github-action/configuration
urls: 'https://${{ env.NETLIFY_SITE_NAME }}.netlify.app'
outputDirectory: ./lighthouse-artifacts
device: 'all'
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: lighthouse
path: ./lighthouse-artifacts