Skip to content
Open

1 #503

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
73cf126
add Tala version line
talaedaly188-cpu Mar 11, 2026
defadde
add CI workflow
talaedaly188-cpu Mar 11, 2026
7aca166
fix CI workflow
talaedaly188-cpu Mar 11, 2026
294db4b
run tests in CI
talaedaly188-cpu Mar 11, 2026
7493afd
add test script
talaedaly188-cpu Mar 11, 2026
aab18e4
update lock file for vitest
talaedaly188-cpu Mar 11, 2026
e1aa1e5
add auth tests
talaedaly188-cpu Mar 11, 2026
5cce2e7
add test coverage
talaedaly188-cpu Mar 11, 2026
0aeabe1
add test coverage2
talaedaly188-cpu Mar 11, 2026
f8071d2
add CI badge
talaedaly188-cpu Mar 11, 2026
fe5de40
Merge pull request #1 from talaedaly188-cpu/addtests
talaedaly188-cpu Mar 11, 2026
4bbc1b1
add style check job
talaedaly188-cpu Mar 11, 2026
25bf358
add prettier format scripts
talaedaly188-cpu Mar 11, 2026
fe2ab08
fix lock file for ci
talaedaly188-cpu Mar 11, 2026
9f2c3bd
fix prettier formatting
talaedaly188-cpu Mar 11, 2026
e3ed37a
add lint step to CI
talaedaly188-cpu Mar 11, 2026
cada97e
fix ci workflow
talaedaly188-cpu Mar 11, 2026
f8a8ed8
fix formatting with prettier
talaedaly188-cpu Mar 11, 2026
bcbef53
remove unused function and fix lint scope
talaedaly188-cpu Mar 11, 2026
9a86f60
fix prettier formatting
talaedaly188-cpu Mar 11, 2026
c296696
fail CI on lint warnings
talaedaly188-cpu Mar 11, 2026
813e717
trigger security warning
talaedaly188-cpu Mar 12, 2026
d259839
run eslint on full src directory
talaedaly188-cpu Mar 12, 2026
97d483f
fix security warnings
talaedaly188-cpu Mar 12, 2026
1389948
fix security issue with randomBytes
talaedaly188-cpu Mar 12, 2026
59241ed
allow any in test file
talaedaly188-cpu Mar 12, 2026
4b01d53
fix import extension for docker build
talaedaly188-cpu Mar 12, 2026
6985ac9
Merge branch 'addtests'
talaedaly188-cpu Mar 12, 2026
0146ee3
fix vitest test import
talaedaly188-cpu Mar 12, 2026
c3106a8
Update cd.yml
talaedaly188-cpu Mar 12, 2026
1162a69
Update cd.yml 3
talaedaly188-cpu Mar 12, 2026
26d8d4a
update title
talaedaly188-cpu Mar 12, 2026
ed50e9e
fix cd pipeline
talaedaly188-cpu Mar 12, 2026
b42694a
trigger workflow
talaedaly188-cpu Mar 13, 2026
5562902
add migrations to cd
talaedaly188-cpu Mar 13, 2026
c5a2aaf
Update cd.yml
talaedaly188-cpu Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added ...]]
Empty file.
51 changes: 51 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: cd

on:
push:
branches: [main]

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest

env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build app
run: npm run build

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2

- name: Build and Push Docker image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/nootely-for-key/notely-ar-repo/notely:latest .

- name: Run database migrations
run: npm run db:migrate

- name: Deploy to Cloud Run
run: |
gcloud run deploy notely \
--image us-central1-docker.pkg.dev/nootely-for-key/notely-ar-repo/notely:latest \
--region us-central1 \
--allow-unauthenticated \
--project nootely-for-key \
--max-instances=4
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci

on:
pull_request:
branches: [main]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test -- --coverage

style:
name: Style
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Run linter
run: npm run lint -- --max-warnings=0
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![CI](https://github.com/talaedaly188-cpu/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)
# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).
Expand All @@ -22,3 +23,4 @@ npm run dev
_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!
Tala's version of Boot.dev's Notely app.
Empty file added [--include
Empty file.
Empty file added [--omit
Empty file.
Empty file added ]
Empty file.
19 changes: 19 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
import pluginSecurity from "eslint-plugin-security";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: { globals: globals.node },
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading