Skip to content

Merge pull request #206 from adobecom/cwv-ui #218

Merge pull request #206 from adobecom/cwv-ui

Merge pull request #206 from adobecom/cwv-ui #218

Workflow file for this run

name: Merge
on:
push:
branches:
- 'main'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions: write-all
jobs:
run-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.13.1
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: npm install
- run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
record-web-vitals:
runs-on: ubuntu-latest
needs: run-release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.13.1
cache: 'npm'
- name: Install dependencies
run: |
npm ci
npm install puppeteer web-vitals
- name: Install Chrome dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2
- name: Record Web Vitals
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node scripts/record-web-vitals.js
- name: Commit updated history
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
# Stash any changes including untracked files
git stash --include-untracked
# Get latest changes
git pull --rebase origin main
# Reapply our changes
git stash pop
git add web-vitals-history.json
git commit -m "chore: update web vitals history [skip ci]" || echo "No changes to commit"
git push origin main || echo "No changes to push"