Diff Page Updates #471
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Diff Page Updates | |
on: | |
schedule: | |
- cron: '23 8 * * *' | |
workflow_dispatch: | |
jobs: | |
diff: | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/playwright/python:v${{ vars.PLAYWRIGHT_VERSION }} | |
options: --user 1001 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ vars.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ vars.PYTHON_VERSION }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install bs4 playwright==${{ vars.PLAYWRIGHT_VERSION }} pytest-playwright requests | |
- name: Remove all HTML to track Deleted Pages | |
run: rm -f content/pages/*.html | |
- name: Download Guide Page HTML | |
id: download | |
env: | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_ENDPOINT: ${{ secrets.API_ENDPOINT }} | |
API_SITE_ID: ${{ secrets.API_SITE_ID }} | |
API_KEY: ${{ secrets.API_KEY }} | |
SITE_BASE_URL: ${{ secrets.SITE_BASE_URL }} | |
run: pytest --video on -sv .github/workflows/pages.py | |
continue-on-error: true | |
- name: Commit Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '--no-ignore-removal -- content/*' | |
default_author: github_actions | |
message: 'π track changes to page content' | |
- name: Upload Video | |
if: steps.download.outcome != 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: video-${{ github.sha }} | |
path: test-results/github-workflows-pages-py-test-diff-chromium | |
- name: Exit | |
if: steps.download.outcome != 'success' | |
run: exit 1 |