Daily Cron Job #533
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: Daily Cron Job | |
on: | |
schedule: | |
- cron: "30 1 * * *" | |
workflow_dispatch: | |
env: | |
TZ: "Asia/Saigon" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Load Secret Key to File | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }} | |
run: | | |
mkdir -p sheet | |
echo "${SERVICE_ACCOUNT}" > sheet/service-account.json | |
- name: Setup bun 🔧 | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun i --production | |
- name: Run job | |
env: | |
DATA_DOG_TOKEN: ${{ secrets.DATA_DOG_TOKEN }} | |
GOOGLE_SHEET_EMAIL: ${{ secrets.GOOGLE_SHEET_EMAIL }} | |
GOOGLE_SHEET_ID: ${{ secrets.GOOGLE_SHEET_ID }} | |
MONGODB_URI: ${{ secrets.MONGODB_URI }} | |
DATA_DOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }} | |
DATA_DOG_APP_KEY: ${{ secrets.DATA_DOG_APP_KEY }} | |
run: bun run bun-start |