Skip to content

Scrape and commit #1201

Scrape and commit

Scrape and commit #1201

Workflow file for this run

name: Scrape and commit
on:
schedule:
# 9am on a friday
#- cron: '00 09 * * 5'
- cron: '00 11 * * *'
push:
branches:
- main
# requires this setting up https://actionsflow.github.io/docs/self-hosted/
# rss:
# url:
# - https://feeds.fireside.fm/selfhosted/rss
# - https://feeds.fireside.fm/coder/rss
# - https://feeds.fireside.fm/linuxunplugged/rss
# - https://feeds.fireside.fm/linuxactionnews/rss
# - https://feeds.fireside.fm/extras/rss
# config:
# limit: 15
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# scrape fireside for latest shows
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: 'x64'
- name: Install deps and scrape fireside
run: |
pip install -U -r requirements.txt
python3 scrape.py
# automatically adds changed files in docs directory to git
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Automatically scraped and committed via a GitHub Action."
commit_user_name: GitHub Action
commit_user_email: [email protected]
commit_author: GitHub Action <[email protected]>
deploy_changes:
runs-on: ubuntu-latest
needs: scrape
steps:
- uses: actions/checkout@v2
# Build
- name: Pull latest changes on VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && git fetch && git checkout main && git pull
- name: Build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && docker run -v $(pwd):/docs squidfunk/mkdocs-material:7.2.8 build