From 6c8b848fcc29f8bc86085e2a0914a3a2ca35e714 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 19:11:34 +0300 Subject: [PATCH 01/24] editing the README.me --- README.md | 3 +++ Untitled | 1 + 2 files changed, 4 insertions(+) create mode 160000 Untitled diff --git a/README.md b/README.md index c2bec0368b..416060fafe 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,6 @@ go build -o notely && ./notely *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! + + + Aycoi's version of Boot.dev's Notely app \ No newline at end of file diff --git a/Untitled b/Untitled new file mode 160000 index 0000000000..a759e37288 --- /dev/null +++ b/Untitled @@ -0,0 +1 @@ +Subproject commit a759e37288a16648b2d73e96b0a07ba52d85ad90 From 47d6b93a97ce0dc52b85884e14208cbc905b99b9 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 19:36:34 +0300 Subject: [PATCH 02/24] adding yml file --- .github/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/ci.yml diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 0000000000..664032071d --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,22 @@ +name: ci + +on: + pull_request: + branches: [main] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.26.0" + + - name: Force Failure + run: (exit 1) \ No newline at end of file From c5889de5e49bebee89f25239f42bdab9b126e497 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 20:55:24 +0300 Subject: [PATCH 03/24] move ci.yml to workflows folder --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..664032071d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: ci + +on: + pull_request: + branches: [main] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.26.0" + + - name: Force Failure + run: (exit 1) \ No newline at end of file From 80019f64b369f223ec716ea7b2b119a34399e452 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 21:05:59 +0300 Subject: [PATCH 04/24] update the yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 664032071d..d64b828150 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Force Failure - run: (exit 1) \ No newline at end of file + - name: Check Go version + run: go version \ No newline at end of file From a03a22520fb3e2c24b80ec4dcba9bc308a321603 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 21:39:20 +0300 Subject: [PATCH 05/24] add unit test to GetAPIkey --- .github/ci.yml | 22 ------------- internal/auth/get_api_key_test.go | 53 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 22 deletions(-) delete mode 100644 .github/ci.yml create mode 100644 internal/auth/get_api_key_test.go diff --git a/.github/ci.yml b/.github/ci.yml deleted file mode 100644 index 664032071d..0000000000 --- a/.github/ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: ci - -on: - pull_request: - branches: [main] - -jobs: - tests: - name: Tests - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v6 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.26.0" - - - name: Force Failure - run: (exit 1) \ No newline at end of file diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go new file mode 100644 index 0000000000..e3ea39fb79 --- /dev/null +++ b/internal/auth/get_api_key_test.go @@ -0,0 +1,53 @@ +package auth + +import ( + "errors" + "net/http" + "testing" +) + +func TestGetAPIKey(t *testing.T) { + tests := map[string]struct { + headers http.Header + wantKey string + wantErr error + }{ + "valid api key": { + headers: http.Header{"Authorization": []string{"ApiKey my-secret-key"}}, + wantKey: "my-secret-key", + wantErr: nil, + }, + "no auth header": { + headers: http.Header{}, + wantKey: "", + wantErr: ErrNoAuthHeaderIncluded, + }, + "malformed - wrong prefix": { + headers: http.Header{"Authorization": []string{"Bearer my-secret-key"}}, + wantKey: "", + wantErr: errors.New("malformed authorization header"), + }, + "malformed - missing key": { + headers: http.Header{"Authorization": []string{"ApiKey"}}, + wantKey: "", + wantErr: errors.New("malformed authorization header"), + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + gotKey, gotErr := GetAPIKey(tc.headers) + + if gotKey != tc.wantKey { + t.Errorf("expected key %q, got %q", tc.wantKey, gotKey) + } + if (gotErr == nil) != (tc.wantErr == nil) { + t.Errorf("expected error %v, got %v", tc.wantErr, gotErr) + return + } + if gotErr != nil && gotErr.Error() != tc.wantErr.Error() { + t.Errorf("expected error %q, got %q", tc.wantErr.Error(), gotErr.Error()) + } + }) + } +} \ No newline at end of file From 6fbb8f4d313f20ebfa0dca0b5de888b82cb4c3d6 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 21:50:09 +0300 Subject: [PATCH 06/24] testing our weather unit test work --- .github/workflows/ci.yml | 4 ++-- internal/auth/auth.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d64b828150..3310dba764 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Check Go version - run: go version \ No newline at end of file + - name: Testing + run: go test ./... \ No newline at end of file diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f969aacf63..f920f5c6d5 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -12,7 +12,8 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") func GetAPIKey(headers http.Header) (string, error) { authHeader := headers.Get("Authorization") if authHeader == "" { - return "", ErrNoAuthHeaderIncluded + //return "", ErrNoAuthHeaderIncluded + return "", ErrNoAuthHeaderIncluded; } splitAuth := strings.Split(authHeader, " ") if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { From d0c018da0d968d32c8023b3b78f747cb37b8eefa Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 21:53:30 +0300 Subject: [PATCH 07/24] sabotage the code --- internal/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f920f5c6d5..fddb43a244 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -13,7 +13,7 @@ func GetAPIKey(headers http.Header) (string, error) { authHeader := headers.Get("Authorization") if authHeader == "" { //return "", ErrNoAuthHeaderIncluded - return "", ErrNoAuthHeaderIncluded; + return "", ErrNoAuthH } splitAuth := strings.Split(authHeader, " ") if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { From 630e492c45671ad8479cb3c6e15ae235cbb99498 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 21:54:57 +0300 Subject: [PATCH 08/24] fixing the code --- internal/auth/auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index fddb43a244..f969aacf63 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -12,8 +12,7 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") func GetAPIKey(headers http.Header) (string, error) { authHeader := headers.Get("Authorization") if authHeader == "" { - //return "", ErrNoAuthHeaderIncluded - return "", ErrNoAuthH + return "", ErrNoAuthHeaderIncluded } splitAuth := strings.Split(authHeader, " ") if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { From ca387717bf074f6c01774ce1fa1105489f152735 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 22:14:41 +0300 Subject: [PATCH 09/24] add coverage flag --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3310dba764..86986bfe51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.26.0" - name: Testing - run: go test ./... \ No newline at end of file + run: go test -cover ./... \ No newline at end of file From ef619ba69191bc7e0eddef9ecd60841a710228c1 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 29 Jul 2026 22:20:41 +0300 Subject: [PATCH 10/24] add test badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 416060fafe..ac0dc1db27 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +![Tests](https://github.com/Aycoi/learn-cicd-starter/actions/workflows/ci.yml/badge.svg) # learn-cicd-starter (Notely) This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). From 32e713c1a2bd621913cefe9b62481d7dbada15bc Mon Sep 17 00:00:00 2001 From: Aycoi Date: Thu, 30 Jul 2026 19:34:18 +0300 Subject: [PATCH 11/24] add formatting test --- .github/workflows/ci.yml | 18 +++++++++++++++++- internal/auth/get_api_key_test.go | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86986bfe51..95d9db4034 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,20 @@ jobs: go-version: "1.26.0" - name: Testing - run: go test -cover ./... \ No newline at end of file + run: go test -cover ./... + + style: + name: Style + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.26.0" + + - name: Formatting + run: test -z $(go fmt ./...) diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go index e3ea39fb79..fbfaef09b4 100644 --- a/internal/auth/get_api_key_test.go +++ b/internal/auth/get_api_key_test.go @@ -50,4 +50,4 @@ func TestGetAPIKey(t *testing.T) { } }) } -} \ No newline at end of file +} From c7281e92c495bf1dab852d627ccd4f4f44647c13 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Tue, 4 Aug 2026 23:13:28 +0300 Subject: [PATCH 12/24] add staticcheck to workflow --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 19d7366c5f..5e638462fc 100644 --- a/main.go +++ b/main.go @@ -95,4 +95,11 @@ func main() { log.Printf("Serving on port: %s\n", port) log.Fatal(srv.ListenAndServe()) + } + + +func unused() { + // this function does nothing + // and is called nowhere +} \ No newline at end of file From 0c84bb06b91d90d12ddcc200d24172796337bdef Mon Sep 17 00:00:00 2001 From: Aycoi Date: Tue, 4 Aug 2026 23:16:41 +0300 Subject: [PATCH 13/24] add staticcheck to workflow --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95d9db4034..18053818ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,3 +36,7 @@ jobs: - name: Formatting run: test -z $(go fmt ./...) + + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + From 1b3ea59b3ba5cf283729ddc48387ab06d5e5c469 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Tue, 4 Aug 2026 23:39:51 +0300 Subject: [PATCH 14/24] fixing the workflow --- main.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.go b/main.go index 5e638462fc..bf45b3a455 100644 --- a/main.go +++ b/main.go @@ -99,7 +99,3 @@ func main() { } -func unused() { - // this function does nothing - // and is called nowhere -} \ No newline at end of file From fc707ec93bf18ed1c515f0ef6f1f3b9115f3392f Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 00:02:40 +0300 Subject: [PATCH 15/24] gofmt main.go to fix CI formatting check --- main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/main.go b/main.go index bf45b3a455..cd3d2ddf20 100644 --- a/main.go +++ b/main.go @@ -97,5 +97,3 @@ func main() { log.Fatal(srv.ListenAndServe()) } - - From fe909dc7efb51c6720c0968512cc336985cc36b6 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 00:05:09 +0300 Subject: [PATCH 16/24] Fix gofmt on main.go and run staticcheck in CI --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18053818ac..f510d206de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,6 @@ jobs: - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest + - name: Staticcheck + run: staticcheck ./... + From 20d1d447e54503596661403d93f6dd0edd577eaa Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 00:29:46 +0300 Subject: [PATCH 17/24] just adding installation step to install gosec --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f510d206de..2c91acda17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,9 @@ jobs: - name: Testing run: go test -cover ./... + + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest style: name: Style From 808fb739b52468c4c175d13dfe4617c00863a8db Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 00:35:17 +0300 Subject: [PATCH 18/24] Run gosec without fixing code | result'FAIL' --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c91acda17..ce4245dc32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,12 @@ jobs: - name: Testing run: go test -cover ./... - + - name: Install gosec run: go install github.com/securego/gosec/v2/cmd/gosec@latest + + - name: Run gosec + run: gosec ./... style: name: Style From 91db0e267783b63479b2e458a44b8c103faa5ccf Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 01:10:13 +0300 Subject: [PATCH 19/24] fixing the sec issues --- json.go | 5 ++++- main.go | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/json.go b/json.go index 1e6e7985e1..c72d9a4f36 100644 --- a/json.go +++ b/json.go @@ -30,5 +30,8 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } w.WriteHeader(code) - w.Write(dat) + _, err = w.Write(dat) + if err != nil { + log.Printf("Error writing response: %s", err) + } } diff --git a/main.go b/main.go index cd3d2ddf20..a8c0c6efeb 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,8 @@ import ( "log" "net/http" "os" + "strings" + "time" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -31,6 +33,8 @@ func main() { } port := os.Getenv("PORT") + port = strings.ReplaceAll(port, "\n", "") + port = strings.ReplaceAll(port, "\r", "") if port == "" { log.Fatal("PORT environment variable is not set") } @@ -89,8 +93,9 @@ func main() { router.Mount("/v1", v1Router) srv := &http.Server{ - Addr: ":" + port, - Handler: router, + ReadHeaderTimeout: 2 * time.Second, // Time allowed to read request headers + Addr: ":" + port, + Handler: router, } log.Printf("Serving on port: %s\n", port) From 7b654b2063abefed66b890cc9aa4eb0fd3284b32 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Wed, 5 Aug 2026 21:40:58 +0300 Subject: [PATCH 20/24] add cd workflow --- .github/.DS_Store | Bin 0 -> 6148 bytes .github/workflows/.DS_Store | Bin 0 -> 6148 bytes .github/workflows/cd.yml | 21 +++++++++++++++++++++ .github/workflows/ci.yml | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/.DS_Store create mode 100644 .github/workflows/.DS_Store create mode 100644 .github/workflows/cd.yml diff --git a/.github/.DS_Store b/.github/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a7c529c7492bfdacff74ba49167403e9ac89fef2 GIT binary patch literal 6148 zcmeHK-D(p-6h5boHfhyv+C&>sSj~3A>xb_A0O7 z1NZpn7VLrDVeRJ&+^3w}sY7-5Fk+0W{wm#W%#!*U zyU}!3V?PpMSQT-Q1cEnS#IMDuoUo%Z?+O}m7_d>LFGKM@i(Tq(<^g0H#;TEfMwwC7?9_KODfSb zIM%3+4r=7@gN&ynN+DamB_z5AJ%eM76d^%fN~lZGJTXw0lixLYp24w3T@I*5rhd%G zXkI9&Mkl|k(g8h3h6tuvF8 wcdbi$Kq^J%jWwzgYRq-440#oAkSd{=D-A-=;8-JhNbHY*qQN$nfq%-tFSmu2OaK4? literal 0 HcmV?d00001 diff --git a/.github/workflows/.DS_Store b/.github/workflows/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..df20869dcb63262bc71fb474a9c330ed23edf110 GIT binary patch literal 6148 zcmeHLF-`+P474Fak!Vst;R#)l!zIaCl#1fuPcTp9r;#uL*bN|bo1C5>(tI(Hx!TE zk#A9MJ|rqi0V&WcaGApu`~MyM%>BP7X(R=tz`s(!7u$y|KeSbEo&7oX+6I4we;R6| k9HBb|V8B*<^R2G&8FfS9lo)j6gAUX|fV#+}z+Wiv0nQ629{>OV literal 0 HcmV?d00001 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000000..fbb3107a3d --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,21 @@ +name: CD + +on: + push: + branches: [main] +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.26.0" + + - name: Build production binary + run: ./scripts/buildprod.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce4245dc32..fdd6239458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: CI on: pull_request: From 9470c48657a2f25a05e1cb91549c893441044088 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Mon, 10 Aug 2026 18:59:29 +0300 Subject: [PATCH 21/24] add build/push to the workflow --- .github/workflows/cd.yml | 12 ++++++++++++ .gitignore | 1 + FILE_NAME | 12 ++++++++++++ macOS | 12 ++++++++++++ macOS64-bitmacOS64-bit | 12 ++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 FILE_NAME create mode 100644 macOS create mode 100644 macOS64-bitmacOS64-bit diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fbb3107a3d..f9e4047c15 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,3 +19,15 @@ jobs: - name: Build production binary run: ./scripts/buildprod.sh + + - id: 'auth' + name: 'Authenticate to Google Cloud' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v3' + + - name: 'Build and push Docker image' + run: 'gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest .' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2092f54e78..ae28bb60c3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ out .env learn-cicd-starter notely +key.json diff --git a/FILE_NAME b/FILE_NAME new file mode 100644 index 0000000000..7d99693937 --- /dev/null +++ b/FILE_NAME @@ -0,0 +1,12 @@ + + + + + + Error 404 (Not Found)!!1 + + +

404. That’s an error. +

That’s all we know. diff --git a/macOS b/macOS new file mode 100644 index 0000000000..7d99693937 --- /dev/null +++ b/macOS @@ -0,0 +1,12 @@ + + + + + + Error 404 (Not Found)!!1 + + +

404. That’s an error. +

That’s all we know. diff --git a/macOS64-bitmacOS64-bit b/macOS64-bitmacOS64-bit new file mode 100644 index 0000000000..7d99693937 --- /dev/null +++ b/macOS64-bitmacOS64-bit @@ -0,0 +1,12 @@ + + + + + + Error 404 (Not Found)!!1 + + +

404. That’s an error. +

That’s all we know. From 714175385d6b21dbe4ff2d1fee396c79963a75e1 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Mon, 10 Aug 2026 20:22:45 +0300 Subject: [PATCH 22/24] Deploy to Cloud Run --- .github/workflows/cd.yml | 5 ++++- static/index.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f9e4047c15..7fc13cf9c0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,4 +30,7 @@ jobs: uses: 'google-github-actions/setup-gcloud@v3' - name: 'Build and push Docker image' - run: 'gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest .' \ No newline at end of file + run: 'gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest .' + + - name: Deploy to Cloud Run + run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-504618 --max-instances=4 \ No newline at end of file diff --git a/static/index.html b/static/index.html index 72be101028..5d4ad73c09 100644 --- a/static/index.html +++ b/static/index.html @@ -7,7 +7,7 @@ -

Notely

+

Welcome to Notely

From af9b0de3cf3691b10d8358c0ea73e1017357920c Mon Sep 17 00:00:00 2001 From: Aycoi Date: Mon, 10 Aug 2026 20:30:13 +0300 Subject: [PATCH 23/24] 'fix' Deploy to Cloud Run --- .github/workflows/cd.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7fc13cf9c0..5a1dfdf0af 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,17 +20,17 @@ jobs: - name: Build production binary run: ./scripts/buildprod.sh - - id: 'auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v2' + - id: "auth" + name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@v2" with: - credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + credentials_json: "${{ secrets.GCP_CREDENTIALS }}" - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v3' + - name: "Set up Cloud SDK" + uses: "google-github-actions/setup-gcloud@v3" - - name: 'Build and push Docker image' - run: 'gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest .' + - name: "Build and push Docker image" + run: "gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest ." - name: Deploy to Cloud Run - run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-504618 --max-instances=4 \ No newline at end of file + run: gcloud run deploy notely --image northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-504618 --max-instances=4 From 17292157a7b7aae08c7b7c51b926714235b33534 Mon Sep 17 00:00:00 2001 From: Aycoi Date: Tue, 11 Aug 2026 16:36:00 +0300 Subject: [PATCH 24/24] add db migration + install goose --- .github/workflows/cd.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5a1dfdf0af..0fc87e4df6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,6 +8,9 @@ jobs: name: Deploy runs-on: ubuntu-latest + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + steps: - name: Check out code uses: actions/checkout@v6 @@ -17,6 +20,9 @@ jobs: with: go-version: "1.26.0" + - name: Install goose + run: go install github.com/pressly/goose/v3/cmd/goose@latest + - name: Build production binary run: ./scripts/buildprod.sh @@ -32,5 +38,8 @@ jobs: - name: "Build and push Docker image" run: "gcloud builds submit --tag northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest ." + - name: Run database migrations + run: ./scripts/migrateup.sh + - name: Deploy to Cloud Run run: gcloud run deploy notely --image northamerica-northeast1-docker.pkg.dev/notely-504618/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-504618 --max-instances=4