posts-published-daily #164
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: 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 |