-
Notifications
You must be signed in to change notification settings - Fork 40
36 lines (34 loc) · 1.09 KB
/
website.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
name: website
on:
push:
branches:
- website
jobs:
update-news-date:
name: Update post news date
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Update dates of news posts
run: tools/update_news_date.py -b website content/news/
- name: Check if changes any changes were made
run: echo "GIT_DIRTY=$(git diff --quiet ; printf "%d" "$?")" >> "${GITHUB_ENV}"
- uses: EndBug/add-and-commit@v5
if: env.GIT_DIRTY != null && env.GIT_DIRTY != '0'
with:
add: 'content/news'
message: 'content/news: Update blog post date after merge'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Netlify build
if: env.NETLIFY_BUILD_HOOK != null && env.GIT_DIRTY != null && env.GIT_DIRTY != '0'
run: curl -X POST -d {} ${{ env.NETLIFY_BUILD_HOOK }}
env:
NETLIFY_BUILD_HOOK: ${{ secrets.NETLIFY_BUILD_HOOK }}