-
Notifications
You must be signed in to change notification settings - Fork 17
42 lines (40 loc) · 1.53 KB
/
autopost.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
name: Autopost
on:
schedule:
- cron: "30 0 * * *" # every day at 7:30am GMT+7
workflow_dispatch: # for manual trigger - testing
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
cd scripts/autopost
pip install -r requirements.txt
- name: Autopost
run: |
cd scripts/autopost
python autopost.py
env:
FB_PAGE_ID: ${{ secrets.FB_PAGE_ID }}
FB_OAUTH_TOKEN: ${{ secrets.FB_OAUTH_TOKEN }}
TG_BOT_CHANNEL: ${{ secrets.TG_BOT_CHANNEL }}
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TW_CONSUMER_KEY: ${{ secrets.TW_CONSUMER_KEY }}
TW_CONSUMER_SECRET: ${{ secrets.TW_CONSUMER_SECRET }}
TW_ACCESS_TOKEN: ${{ secrets.TW_ACCESS_TOKEN }}
TW_ACCESS_TOKEN_SECRET: ${{ secrets.TW_ACCESS_TOKEN_SECRET }}
IG_ACCOUNT_ID: ${{ secrets.IG_ACCOUNT_ID }}
IG_OAUTH_TOKEN: ${{ secrets.IG_OAUTH_TOKEN }}
- name: Commit changes
run: |
git config --global user.name github-actions
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git add -A
git commit -m "autopost" || true
git push --force origin HEAD:$GITHUB_REF || true