Skip to content

Instantly share code, notes, and snippets.

@Jandev
Created September 2, 2025 10:22
Show Gist options
  • Select an option

  • Save Jandev/aa9ce0035732609e416b19e3f71f7f9c to your computer and use it in GitHub Desktop.

Select an option

Save Jandev/aa9ce0035732609e416b19e3f71f7f9c to your computer and use it in GitHub Desktop.
Create weekly link archive for Hugo blog
name: Create weekly useful links page
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * 1' # At 12:00 on Monday
jobs:
create_weekly_links:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Tailscale
uses: tailscale/github-action@v3
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:link-collector
use-cache: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
cd src/linkwarden
pip install -r requirements.txt
- name: Generate weekly links
run: |
cd src/linkwarden
python add_links.py --host "${{ secrets.LINKWARDEN_HOST }}" --access-token "${{ secrets.LINKWARDEN_ACCESSTOKEN }}"
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Add weekly links for ${{ steps.date.outputs.date }}'
file_pattern: 'content/links/**/*.md content/link-overview.md'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment