-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (63 loc) · 2.15 KB
/
scrape.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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