Skip to content

Commit

Permalink
restore the report logic
Browse files Browse the repository at this point in the history
  • Loading branch information
aasimsyed committed May 18, 2024
1 parent 2f41e31 commit 9eba355
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/pr_ci_playwright_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,51 @@ jobs:
run: |
sudo yarn playwright test --reporter=html
- name: Ensure gh-pages branch exists
run: |
git fetch
if ! git show-ref --verify --quiet refs/heads/gh-pages; then
echo "gh-pages branch does not exist. Creating..."
git checkout --orphan gh-pages
git rm -rf .
echo "# GitHub Pages" > index.html
git add index.html
git commit -m "Initial commit"
git push origin gh-pages
fi
- name: Ensure gh-pages branch exists
run: |
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
git add index.html
git -c user.name='github-actions[bot]' -c user.email='github-actions[bot]@users.noreply.github.com' commit -m "Initial commit"
git push origin gh-pages
fi
- name: Deploy Playwright Report to gh-pages
if: always()
run: |
# Configuring git
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Clone the repository to the gh-pages branch
git clone --branch=gh-pages https://github.com/${{ github.repository }} gh-pages || (git clone https://github.com/${{ github.repository }} gh-pages && cd gh-pages && git checkout --orphan gh-pages)
cd gh-pages
# Copying the Playwright report to the gh-pages branch
rm -rf ./*
cp -r ../frontend/playwright-report/* .
# Committing and pushing the changes
git add .
git -c user.name='github-actions[bot]' -c user.email='github-actions[bot]@users.noreply.github.com' commit -m "Update Playwright report"
git push origin gh-pages --force
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 9eba355

Please sign in to comment.