-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (28 loc) · 938 Bytes
/
cron.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
name: Schedule update Contentful data & sitemap
on:
schedule:
- cron: '0 15 * * *'
jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: release
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Fetch Contentful data
run: SPACE_ID=${{secrets.CONTENTFUL_SPACE_ID}} ACCESS_TOKEN=${{secrets.CONTENTFUL_ACCESS_TOKEN}} node ./contentful.js
- name: Update sitemap
run: node ./sitemap.js
- name: Commit to GitHub
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add app/_assets/contentfulEntries.json
git add public/sitemap.txt
git commit -m "Update Contentful data & sitemap" || echo "Nothing to commit"
git push --no-verify