mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
55 lines
1.7 KiB
YAML
55 lines
1.7 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
|
|
|
|
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.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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
|
with:
|
|
# A minimal fetch-depth of 2 is required
|
|
# to automatically detect branch in @argos-ci/cli
|
|
fetch-depth: 2
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Build website fast
|
|
run: yarn build:website:fast
|
|
|
|
- name: Take Argos screenshots
|
|
run: yarn argos:screenshot
|
|
|
|
- name: Upload Argos screenshots
|
|
continue-on-error: true
|
|
run: yarn argos:upload
|