|
|
|
name: Trigger Render Deploy (Overwrite README) |
|
|
|
on: |
|
schedule: |
|
- cron: '0 */8 * * *' |
|
workflow_dispatch: |
|
|
|
permissions: |
|
contents: write |
|
|
|
jobs: |
|
update_readme: |
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
- name: Checkout Repository |
|
uses: actions/checkout@v3 |
|
|
|
- name: Configure Git |
|
run: | |
|
# Configure Git with bot user details |
|
git config user.name "GitHub Actions Bot" |
|
git config user.email "[email protected]" |
|
|
|
- name: Overwrite README.md with latest timestamp |
|
run: | |
|
# Overwrite README.md with only the latest update timestamp |
|
echo "Last automatic update trigger: $(date)" > README.md # Use '>' to overwrite |
|
|
|
- name: Commit and Push Changes |
|
run: | |
|
# Add the modified README.md file to staging |
|
git add README.md |
|
# Check if there are any changes staged for commit |
|
# If there are changes, commit them |
|
# The || true at the end prevents the workflow from failing if there are no changes |
|
git diff --quiet --cached || git commit -m "Automated README update to trigger deploy" |
|
# Push the changes to the main branch |
|
# Assumes your main branch is named 'main' |
|
git push origin main |
|
env: |
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|