Skip to content

docs: add ga4 readme tracking pixels (#4426) #1286

docs: add ga4 readme tracking pixels (#4426)

docs: add ga4 readme tracking pixels (#4426) #1286

Workflow file for this run

name: on push
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Stop previous runs
stop-previous-run:
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
# Create cache for all samples
cache:
runs-on: ubuntu-22.04
needs: stop-previous-run
outputs:
yarnHash: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get Playwright version
id: playwright-version
shell: bash
run: |
version="$(node -p "String(require('./package.json').devDependencies['@playwright/test']||'').replace(/^[^0-9]*/, '')")"
echo "version=$version" >> "$GITHUB_OUTPUT"
# Hash pnpm-lock.yaml files to use it as a cache key, if pnpm-lock.yaml files are changed, the cache will be invalidated
- name: Check pnpm hash
id: yarn-hash
run: |
yarnHash="$(npx hash-files -f '["**/pnpm-lock.yaml"]' -a sha256)"
echo "yarnHash=$yarnHash" >> $GITHUB_OUTPUT
- name: Enable corepack
run: corepack enable
- name: Setup Node.js with caching
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Re-enable corepack after setup-node
run: corepack enable
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
id: pnpm-store-cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: pnpm-store-${{ runner.os }}-${{ steps.yarn-hash.outputs.yarnHash }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}-headless-shell
- name: Set Playwright cache status
run: echo "PLAYWRIGHT_CACHE_HIT=${{ steps.playwright-cache.outputs.cache-hit }}" >> $GITHUB_ENV
- name: Install deps
env:
NODE_OPTIONS: '--max_old_space_size=6144'
FORCE_COLOR: 3
run: |
echo "Installing dependencies from pnpm store..."
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pnpm install --frozen-lockfile --prefer-offline
- name: Install Playwright browsers
run: |
# Populate the shared browser cache (no system deps here).
pnpm exec playwright install chromium chromium-headless-shell