chore: add test job #4
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: Deploy | |
on: | |
push: | |
branches: develop | |
pull_request: | |
branches: master | |
env: | |
BOT_TOKEN: ${{secrets.BOT_TOKEN}} | |
APP_ENV: ${{secrets.APP_ENV}} | |
GEMINI_API_KEY: ${{secrets.GEMINI_API_KEY}} | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
env: | |
APP_ENV: test | |
BOT_TOKEN: dummy | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- uses: denoland/setup-deno@main | |
with: | |
deno-version: v1.x | |
# - name: Cache Dependencies | |
# run: deno cache src/bot.ts | |
- name: Run Tests | |
run: deno task test | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Needed for auth with Deno Deploy | |
contents: read # Needed to clone the repository | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Upload to Deno Deploy | |
uses: denoland/deployctl@v1 | |
with: | |
project: "hn-telegram-bot" | |
entrypoint: "src/bot.ts" | |
root: "." |