Skip to content

Commit

Permalink
updated robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
aryonoco committed Dec 6, 2024
1 parent 622572f commit f75f8b9
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/update-robots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@ name: Update robots.txt

on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight
- cron: "0 7 * * *" # Runs daily at 7 AM UTC
workflow_dispatch: # Allows manual triggering

permissions:
contents: write # Required to push changes

jobs:
update-robots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "14"
- run: npm ci
- run: npm run update-robots
node-version: "22.12.0"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Update robots.txt
run: npm run update-robots

- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add src/pages/robots.txt.ts
git commit -m "Update robots.txt" || echo "No changes to commit"
git push
git diff --quiet && git diff --staged --quiet || git commit -m "chore: update robots.txt"
- name: Push changes
run: git push

0 comments on commit f75f8b9

Please sign in to comment.