mirror of
https://github.com/facebook/docusaurus.git
synced 2026-06-28 11:41:57 -04:00
449eca0f48
Signed-off-by: dependabot[bot] <support@github.com>
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
name: Argos CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
types:
|
|
# Those 3 are the default PR workflow activity types,
|
|
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
# We want trigger workflow on labeled too!
|
|
- labeled
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
take-screenshots:
|
|
# Argos is heavy to run
|
|
# We only want to trigger Argos on PRs with the 'Argos' label
|
|
# See https://stackoverflow.com/questions/62325286/run-github-actions-when-pull-requests-have-a-specific-label
|
|
if: |
|
|
github.repository == 'facebook/docusaurus' &&
|
|
(
|
|
(github.event_name != 'pull_request' && github.ref_name == 'main') ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Argos'))
|
|
)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: lts/*
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile
|
|
|
|
- name: Install Playwright browsers
|
|
run: pnpm playwright install --with-deps chromium
|
|
|
|
- name: Build website fast
|
|
run: pnpm argos:build
|
|
|
|
- name: Take Argos screenshots
|
|
run: pnpm argos:screenshot
|