Build #429
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: Build | |
# This workflow will install Deno then run `deno fmt`, `deno lint`, and `deno test`. | |
# For more information see: https://github.com/denoland/setup-deno | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
merge_group: | |
schedule: | |
- cron: "0 14 * * 1" # every monday at 9 in the morning CST | |
workflow_dispatch: | |
permissions: | |
contents: read # Needed to clone the repository | |
defaults: | |
run: | |
shell: bash | |
env: | |
CI: true | |
DENO_VERSION: v2.0.2 | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Needed for auth with Deno Deploy | |
pull-requests: write # Needed for biome comments | |
env: | |
OPENAI_BASE_URL: https://mockgpt.wiremockapi.cloud/v1 | |
OPENAI_API_KEY: sk-3eo4svsr4bah2qc9h70sdbvrf12du8o4 | |
steps: | |
- name: π Git checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: recursive | |
clean: true | |
persist-credentials: false | |
set-safe-directory: true | |
- name: π¦ Install Deno | |
uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba # v1.1.4 | |
with: | |
deno-version: ${{ env.DENO_VERSION }} | |
- name: π¦ Cache dependencies | |
run: deno install | |
- name: π΅οΈ Run linter, verify formatting, typecheck | |
run: deno task ci | |
- name: π¨ Build | |
run: deno task build | |
- name: π§ͺ Run tests | |
run: deno task test | |
- name: π Collect coverage | |
run: deno task test:coverage | |
- name: π² No uncommited changes | |
uses: infotroph/tree-is-clean@e99ff204c7e1f74fd4de0822e86adb01f2ca2138 # v1.0.4 | |
- name: π§ Upload to Deno Deploy | |
id: deno-deploy | |
uses: denoland/deployctl@612f83df2b874c6908d68de5cf3f36a6538fa8f7 # 1.12.0 | |
with: | |
project: "why-switch" | |
entrypoint: src/main.ts | |
include: | | |
src | |
deno.json | |
- name: π¦ Lighthouse | |
uses: treosh/lighthouse-ci-action@1b0e7c33270fbba31a18a0fbb1de7cc5256b6d39 # 11.4.0 | |
with: | |
urls: | | |
${{ steps.deno-deploy.outputs.url }} | |
${{ steps.deno-deploy.outputs.url }}about/ | |
${{ steps.deno-deploy.outputs.url }}solutions/solar/ | |
${{ steps.deno-deploy.outputs.url }}solutions/geothermal/environment/ | |
uploadArtifacts: true |