Skip to content

posts-published-daily #164

posts-published-daily

posts-published-daily #164

name: posts-published-daily
on:
workflow_dispatch:
schedule:
- cron: '12 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 posts by deleting exiting posts
run: rm -f content/posts/*.html
- name: get current content
run: python posts.py ${{ 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 post content [actions]";
fi
- name: Push changes
run: git push