computer - update #3357
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: computer - update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 * * * *" | |
jobs: | |
update: | |
name: Update | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
working-directory: sites/computer.mads-hartmann.com | |
run: npm ci | |
- name: Run script | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
working-directory: sites/computer.mads-hartmann.com | |
run: node scripts/update-from-notion.js > src/pages/index.md | |
- name: Commit changes | |
run: | | |
if [[ -z $(git status -s) ]]; then | |
echo "No changes to commit" | |
exit 0 | |
fi | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -am "Updated from Notion" | |
git push |