From 40fdade643396be1a242b663c784f58b676fa590 Mon Sep 17 00:00:00 2001 From: aasim Date: Fri, 17 May 2024 20:38:13 -0400 Subject: [PATCH] fetch the gh-pages branch from the remote, merge any changes if it exists, or create it if it doesn't exist --- .github/workflows/pr_ci_playwright_e2e.yaml | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index abf358512..c17f18051 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -47,16 +47,29 @@ jobs: run: | sudo yarn install + - name: Cache Playwright browsers + uses: actions/cache@v3 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-browsers-${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }} + restore-keys: | + playwright-browsers-${{ runner.os }}- + - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' working-directory: ./frontend - run: | - sudo yarn playwright install --with-deps + run: sudo yarn playwright install --with-deps + - name: Ensure gh-pages branch exists + if: always() run: | - git fetch - if ! git show-ref --verify --quiet refs/heads/gh-pages; then - echo "gh-pages branch does not exist. Creating..." + git fetch origin gh-pages + if git rev-parse --verify origin/gh-pages; then + git checkout gh-pages + git reset --hard origin/gh-pages + else git checkout --orphan gh-pages git rm -rf . echo "# GitHub Pages" > index.html