From 0f0711d729bd4b210ad15b3dec0d5013ddad6400 Mon Sep 17 00:00:00 2001 From: Yunus Date: Sun, 10 Nov 2024 21:47:36 +0700 Subject: [PATCH] Add cache playwright and deploy --- .github/workflows/deploy.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 200eb63..e31c011 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,8 +14,26 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile - run: bun run tests + + + # E2E tests + - name: Get installed Playwright version + id: playwright-version + run: | + playwrightVersion=$(bunx playwright --version) + echo "version=$playwrightVersion" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 + id: playwright-cache + with: + path: '~/.cache/ms-playwright' + key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' + restore-keys: | + ${{ runner.os }}-playwright- - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: bunx playwright install --with-deps - name: Setup e2e env run: echo "${{ secrets.ENV_TESTS_BASE64 }}" | base64 --decode >> .env - run: bun run e2e + - name: Deploy + run: curl -X POST https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/344ca361-b2d3-48e6-b896-ffa2dd1e9a1b