Skip to content

pages-published-daily #171

pages-published-daily

pages-published-daily #171

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