-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (35 loc) · 1.21 KB
/
posts-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: 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