Skip to content

Merge pull request #5577 from tsparticles/v4 #134

Merge pull request #5577 from tsparticles/v4

Merge pull request #5577 from tsparticles/v4 #134

Workflow file for this run

name: Node.js CI
on:
push:
branches: [main, v4, v3, v2, v1]
pull_request:
branches: [main, v4, v3, v2, v1]
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}'
firebaseToken: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TSPARTICLES }}'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
fetch-depth: 0
- name: Derive SHAs for nx affected
uses: nrwl/nx-set-shas@v4
- uses: actions/setup-node@v6
with:
node-version: '24'
- uses: pnpm/action-setup@v4.2.0
with:
run_install: false
- name: Initialize Nx Cloud
run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js"
- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install
- name: Prettify README
run: pnpm run prettify:ci:readme
- name: Build packages
run: npx nx affected -t build:ci
- if: env.firebaseToken != '' && github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TSPARTICLES }}'
projectId: tsparticles
channelId: live
- if: env.firebaseToken != '' && github.event_name == 'pull_request' && github.actor == 'matteobruni'
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TSPARTICLES }}'
projectId: tsparticles
- name: Stop Nx Cloud Session
run: npx nx fix-ci
if: always()