News #152
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: news | |
on: | |
schedule: | |
- cron: '59 9 * * *' | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
news: | |
environment: Production | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Run install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: Update News | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: 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 | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: format | |
- name: Commit as Bot | |
run: | | |
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 |