React Web Deploy

react-web-deploy@1.0.0 Template

Ready-made pipeline: lint and test on every push to main, then build and deploy to Firebase Hosting.

Start from it

flightstack template use react-web-deploy

What it does

A complete React web pipeline: lint and test on every push to main, then build and deploy to Firebase Hosting with the built bundle asserted before it can ship.

Definition

name: React Web Deploy
description: >-
  Lint and test on every push to main, then build and deploy to Firebase
  Hosting - with the built bundle checked before it can ship.

triggers:
  - type: push
    branches: [main]
  - type: manual

jobs:
  checks:
    name: Lint and test
    type: plugin/node-scripts
    with:
      workingDir: "{{workingDir}}"
      scripts:
        - lint
        - test

  deploy:
    name: Build and deploy
    type: plugin/react-deploy-firebase
    depends_on: [checks]
    with:
      workingDir: "{{workingDir}}"
      projectId: "{{firebaseProjectId}}"
      site: "{{firebaseSite}}"
      outputDir: "{{outputDir}}"
      buildScript: "{{buildScript}}"
      env:
        VITE_API_URL: "{{apiUrl}}"
      mustContain:
        - "{{apiUrl}}"
      mustNotContain:
        - "localhost:"
        - "127.0.0.1"