-
-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (48 loc) · 1.61 KB
/
news.yaml
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
name: News
on:
schedule:
- cron: '59 18 * * *'
workflow_dispatch:
permissions: write-all
jobs:
news:
environment: Production
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Update News
run: pnpm run worker
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DEEPL_API_KEY: ${{secrets.DEEPL_API_KEY}}
BING_TRANSLATE_KEY: ${{secrets.BING_TRANSLATE_KEY}}
BING_TRANSLATE_REGION: ${{secrets.BING_TRANSLATE_REGION}}
BRIGHTDATA_USERNAME: ${{secrets.BRIGHTDATA_USERNAME}}
BRIGHTDATA_PASSWORD: ${{secrets.BRIGHTDATA_PASSWORD}}
BRIGHTDATA_PROXY: ${{secrets.BRIGHTDATA_PROXY}}
NEWSLETTERS_CHO_SH_USERNAME: ${{secrets.NEWSLETTERS_CHO_SH_USERNAME}}
NEWSLETTERS_CHO_SH_PASSWORD: ${{secrets.NEWSLETTERS_CHO_SH_PASSWORD}}
- name: Run Prettier
run: pnpm run format
- name: Commit as Bot
run: |
git pull
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git diff-index --quiet HEAD || git commit -m "Updating News..."
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main