-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (35 loc) · 1.26 KB
/
pages-published.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
name: pages-published-daily
on:
workflow_dispatch:
schedule:
- cron: '23 8 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
playwright install firefox
- name: track deleted pages by deleting existing pages
run: rm -f content/pages/*.html
- name: Get recently updated content
run: python pages.py ${{ secrets.API_SITE_ID }} ${{ secrets.API_KEY }} ${{ secrets.SITE_BASE_URL }} content
- name: Configure Git identity
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Commit modified and new files
run: if [ -n "$(git ls-files --modified --others)" ];
then
git ls-files --modified --others | xargs git add --all;
git commit -m "🌀 track changes to page content [actions]";
fi
- name: Push changes
run: git push