Skip to content

Schedule update Contentful data & sitemap #345

Schedule update Contentful data & sitemap

Schedule update Contentful data & sitemap #345

Workflow file for this run

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