diff --git a/.github/workflows/reusable-deploy-job.yml b/.github/workflows/reusable-deploy-job.yml index e9fcae7..87b6480 100644 --- a/.github/workflows/reusable-deploy-job.yml +++ b/.github/workflows/reusable-deploy-job.yml @@ -93,3 +93,18 @@ jobs: - name: Deploy Backends run: serverless deploy --stage ${{ inputs.target }} + + - name: Get CloudFront Distribution ID + id: get_dist_id + run: | + BUCKET_NAME="${{ secrets.COMPANY_ABBREVIATION }}-lara-frontend-${{ inputs.target }}" + DIST_ID=$(aws cloudfront list-distributions \ + --query "DistributionList.Items[?Origins.Items[?DomainName=='${BUCKET_NAME}.s3.amazonaws.com']].Id" \ + --output text) + echo "distribution_id=$DIST_ID" >> $GITHUB_OUTPUT + + - name: Invalidate CloudFront cache + run: | + aws cloudfront create-invalidation \ + --distribution-id ${{ steps.get_dist_id.outputs.distribution_id }} \ + --paths "/*" diff --git a/.github/workflows/reusable-e2e-test-job.yml b/.github/workflows/reusable-e2e-test-job.yml index 3029ddd..2514a96 100644 --- a/.github/workflows/reusable-e2e-test-job.yml +++ b/.github/workflows/reusable-e2e-test-job.yml @@ -41,3 +41,10 @@ jobs: yarn npx playwright install npx playwright test + + - name: Upload Playwright test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-test-logs + path: test-results diff --git a/packages/e2e/tests/entry.spec.ts b/packages/e2e/tests/entry.spec.ts index 65d7193..d7e3785 100644 --- a/packages/e2e/tests/entry.spec.ts +++ b/packages/e2e/tests/entry.spec.ts @@ -8,6 +8,7 @@ URL ??= 'http://localhost:8080' async function goto(page: Page, path: string = '') { await page.goto(`${URL}${path}`) const statusBar = page.locator('#status-bar') + await statusBar.waitFor({ timeout: 10000 }) await statusBar.hover() const input = page.locator('#dev-login-user-id')