Config husky and commitlint #21
Workflow file for this run
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: Deploy to Firebase Hosting | |
on: # when does the workflow run? | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: [main] | |
permissions: | |
actions: read # Needed for nx-set-shas | |
contents: read # Needed for nx-set-shas | |
checks: write # Needed for GITHUB_TOKEN | |
env: | |
HUSKY: 0 # Disable Husky hooks | |
jobs: | |
build_and_preview: # name of the job | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 # Checkout the repository at the latest commit | |
with: | |
fetch-depth: 0 # Fetch all history for all branches so that nx affected can compare against all commits | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 # Cache node_modules to speed up builds | |
with: | |
node-version: 18 # Use the version 18 of Node.js | |
cache: 'yarn' # Cache node_modules to speed up builds | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile # Install dependencies using yarn with a frozen lockfile | |
- name: Setup Nx SHA | |
uses: nrwl/nx-set-shas@v3 # Sets environment variables for commit SHAs, optimizing Nx's change detection for efficient CI processes | |
- name: Check Git Branch | |
run: git branch --track main origin/main # This line is needed for nx affected to work when CI is running on a PR | |
- name: Run Nx Format Check | |
run: npx nx format:check # Run the format check | |
- name: Run Nx Affected Commands | |
run: npx nx affected -t lint,test,build --parallel=3 # Run the lint, test, and build targets in parallel | |
- name: Deploy to Firebase Hosting Preview Channel | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: '${{ secrets.GITHUB_TOKEN }}' | |
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_SERIES_V1_DB }}' | |
projectId: series-v1-db | |
#channelId: preview by default if you don't specify it. |