daily #1505
This file contains hidden or 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 | |
| on: | |
| schedule: | |
| # Runs at 00:00, 06:00, 12:00, and 18:00 UTC every day | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| run-node-command: | |
| runs-on: ubuntu-latest | |
| env: | |
| CREEM_API_KEY: ${{ secrets.CREEM_API_KEY }} | |
| LEMONSQUEEZY_API_KEY: ${{ secrets.LEMONSQUEEZY_API_KEY }} | |
| DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v1.2.2 | |
| # - name: Build log | |
| # run: bun build_log.js | |
| - name: Create Discount | |
| run: bun discount_shorttime.js | |
| - name: Configure Git | |
| run: | | |
| git config --local user.email "pouya.saadeghi@gmail.com" | |
| git config --local user.name "Pouya Saadeghi" | |
| - name: Commit changes | |
| run: | | |
| git add . | |
| git diff-index --quiet HEAD || git commit -m "Update API data" | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |