-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.49 KB
/
daily.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
40
41
42
43
44
45
46
47
48
49
50
51
name: Scrape and Update README
on:
schedule:
- cron: '0 2 * * *' # Menjalankan setiap hari pada pukul 5 pagi GMT/7
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v4 # Checkout the repository content to github runner.
- name: Setup Python Version
uses: actions/setup-python@v5
with:
python-version: 3.8 # Install the python version needed
- name: Install Python dependencies
run: python -m pip install --upgrade pip requests beautifulsoup4
- name: Execute Python script # Run the run.py to get the latest data
run: python main.py
- name: Check if there are any changes
id: verify_diff
run: |
git add .
if git diff-index --quiet HEAD --; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update Daily Devotional"
- name: Push
if: steps.verify_diff.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}
branch: ${{ github.ref }}