-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.68 KB
/
pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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