Skip to content

Update recent blog posts and deploy #427

Update recent blog posts and deploy

Update recent blog posts and deploy #427

name: Update recent blog posts and deploy
on:
schedule:
- cron: "0 21 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate recent updates
run: node generateRecentUpdates.js
- name: Commit updates (+ trigger Vercel deploy)
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add .
# Check if there are any changes to commit
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Update recent posts"
git push
fi