Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2f808a1
added new line in README.md
ivankozulic121 Dec 1, 2025
72b91b6
added workflow
ivankozulic121 Dec 1, 2025
08b265d
updated workflow
ivankozulic121 Dec 1, 2025
9a3236e
added broken ci file
ivankozulic121 Dec 2, 2025
1d4896f
fixed npm command
ivankozulic121 Dec 2, 2025
07c4b40
purposely broken tests file
ivankozulic121 Dec 2, 2025
a2685c1
fixed workflow file
ivankozulic121 Dec 2, 2025
eb99f25
fixed tests file
ivankozulic121 Dec 2, 2025
e5bec2a
added test coverage
ivankozulic121 Dec 2, 2025
b824571
increased node version in ci
ivankozulic121 Dec 2, 2025
49fa58d
added style job in ci
ivankozulic121 Dec 2, 2025
8bb1795
fixed style job in ci
ivankozulic121 Dec 2, 2025
1384241
added linting check
ivankozulic121 Dec 2, 2025
b87601b
removed unused function in main.ts file
ivankozulic121 Dec 2, 2025
771a4f1
reformatted main.ts file
ivankozulic121 Dec 2, 2025
27fae4b
added eslint security checks
ivankozulic121 Dec 2, 2025
2683041
fixed pseudoRandomBytes to randomBytes
ivankozulic121 Dec 2, 2025
29cfbed
added cd.yml file
ivankozulic121 Dec 3, 2025
cc686ac
added Google Cloud Services workflow
ivankozulic121 Dec 3, 2025
037787e
fixed cd file
ivankozulic121 Dec 3, 2025
e2f252c
fixed cd file again
ivankozulic121 Dec 3, 2025
633ff11
most recent cd.yml fix
ivankozulic121 Dec 3, 2025
6e113cd
added new command to cd file
ivankozulic121 Dec 15, 2025
9bba984
one more step for cd file
ivankozulic121 Dec 15, 2025
f1cbb29
one more try for cd file
ivankozulic121 Dec 15, 2025
84a094c
fixed gcloud submit command in cd file
ivankozulic121 Dec 15, 2025
7c5e703
changed build command in cd file
ivankozulic121 Dec 15, 2025
7bf75e2
changed html and cd file
ivankozulic121 Dec 16, 2025
f5c46a3
changed cd file again
ivankozulic121 Dec 16, 2025
0039aec
added env to cd file
ivankozulic121 Dec 16, 2025
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
63 changes: 63 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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: 20

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: notely-480100

- name: Use gcloud CLI
run: gcloud info

- name: Who am I?
run: |
gcloud auth list
gcloud config get-value account
gcloud config list

- name: Test Cloud Build bucket write
run: |
echo "test" > /tmp/cb.txt
gcloud storage cp /tmp/cb.txt gs://notely-480100_cloudbuild/_gha_test/cb.txt
gcloud storage ls gs://notely-480100_cloudbuild/_gha_test/


- name: Build and push Docker image
run: gcloud builds submit --gcs-source-staging-dir=gs://notely-480100-cb-staging/source --tag us-central1-docker.pkg.dev/notely-480100/notely-ar-repo/notely:latest .

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

- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-480100/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-480100 --max-instances=4


51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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: 20

- name: Install dependencies
run: npm ci

- name: Run unit 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: 20

- name: Install dependencies
run: npm ci

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

- name: Check linting
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
Expand Up @@ -22,3 +22,5 @@ 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!

"MYNAME's version of Boot.dev's Notely app."
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