-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.42 KB
/
post.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
name: Post
on:
workflow_dispatch:
schedule:
- cron: "24 4,8,13 * * *"
jobs:
sync:
name: Synchronize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: pnpm
uses: pnpm/action-setup@v2
- name: node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- run: pnpm install
- run: docker compose up -d
- run: pnpm wait-on http-get://localhost:20279
- run: pnpm cli --list-events
- run: if test -f .data/next.id.txt; then pnpm cli --prepare-post; else echo Nothing to do; fi
- run: if test -f .data/next.id.txt; then pnpm cli --prepare-image; else echo Nothing to do; fi
- run: if test -f .data/next.id.txt; then pnpm cli --post; else echo Nothing to do; fi
env:
FACEBOOK_PAGE_ACCESS_TOKEN: ${{ secrets.FACEBOOK_PAGE_ACCESS_TOKEN }}
- run: if test -f .data/next.id.txt; then pnpm cli --comment; else echo Nothing to do; fi
env:
FACEBOOK_PAGE_ACCESS_TOKEN: ${{ secrets.FACEBOOK_PAGE_ACCESS_TOKEN }}
- run: git add state && git diff --cached
if: always()
- uses: stefanzweifel/git-auto-commit-action@v4
if: always()
with:
commit_message: Update state file
commit_user_name: "dtinth-bot"
commit_user_email: "[email protected]"
permissions:
contents: write