github_poc_collector/.forgejo/workflows/daily-collect.yaml

43 lines
1 KiB
YAML

name: Daily Feed Update
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update-feed:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: bpmcdevitt/github_poc_collector
ssh-key: ${{ secrets.TOKEN_NAME }}
ssh-known-hosts: git.mcdevitt.tech
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.TOKEN_NAME }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan git.mcdevitt.tech >> ~/.ssh/known_hosts
- name: Run recent feed update
run: |
cargo run -- --feed recent
- name: Commit and push results
run: |
git config user.name bpmcdevitt
git config user.email brendan@mcdevitt.tech
git add .
git commit -m "Update recent feed data" || exit 0
git push