forked from Vinnl/feeds
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (72 loc) · 2.31 KB
/
pages.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
70
71
72
73
74
name: Publish RSS feeds to GitHub Pages
on:
push:
branches: ["main"]
paths:
- "**"
- "!README.md"
schedule:
# * is a special character in YAML so you have to quote this string
# Run every hour:
- cron: "0 * * * *"
workflow_dispatch:
env:
CI: true
jobs:
publish-feeds:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
TWITTER_ACCOUNT_PASSWORD: ${{ secrets.TWITTER_ACCOUNT_PASSWORD }}
TWITTER_COOKIE_VALUE: ${{ secrets.TWITTER_COOKIE_VALUE }}
steps:
- uses: actions/checkout@v4
- run: npx playwright install firefox --with-deps
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npx feed-me-up-scotty
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# trunk-ignore(yamllint/quoted-strings)
cache: "pip"
- run: pip install -r requirements.txt
- run: playwright install firefox --with-deps
# Check the generated XML files from feed-me-up-scotty (at least 1 entry)
- name: Check generated XML feeds
run: python check_feeds.py
- name: Restore tw_session cache
id: cache-tw-session
uses: actions/cache@v3
with:
path: ./SESSION.tw_session
key: SESSION.tw_session
- name: Run twitter.py
run: |
python twitter.py
- name: Save updated tw_session cache
if: always()
uses: actions/cache@v3
with:
path: ./SESSION.tw_session
key: SESSION.tw_session
restore-keys: |
tw-session-
- name: Deploy to GitHub Pages
run: |
git config user.name $GITHUB_ACTOR
git config user.email [email protected]
git remote add gh-pages-remote https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
git fetch --no-recurse-submodules
git worktree add ./gh-pages gh-pages
cd gh-pages
git rm -r .
cp -r ../public/. .
git add .
git commit --message="Deploying to GitHub Pages from $GITHUB_SHA"
git push gh-pages-remote gh-pages:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}