From ceb2cb888886b7f8e685aebad83deaa545e56267 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Fri, 11 Apr 2025 23:05:31 -0400 Subject: [PATCH 01/30] Updated readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2bec0368b..b8f857ea74 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Run the server: go build -o notely && ./notely ``` -*This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8080`. +_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! +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! + +Williams's version of Boot.dev's Notely app. From bfe04594b814eead6c767cc592cee8655b9040c9 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Fri, 11 Apr 2025 23:55:26 -0400 Subject: [PATCH 02/30] added ci --- .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..10315a9274 --- /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@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23.0' + + - name: Force Failure + run: (exit 1) From 69f5005fd9bfb1fcac79a9c7956c066c60896a97 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 09:57:20 -0400 Subject: [PATCH 03/30] updated ci test --- .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 10315a9274..e2583f2471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: '1.23.0' - - name: Force Failure - run: (exit 1) + - name: Print Go version + run: go version From 25a1add836d454933ef371778f45b17b8d774191 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 12:20:23 -0400 Subject: [PATCH 04/30] added apikey test --- internal/auth/auth.go | 5 +++++ internal/auth/auth_test.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 internal/auth/auth_test.go diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f969aacf63..8da3b7ffa0 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -2,6 +2,7 @@ package auth import ( "errors" + "fmt" "net/http" "strings" ) @@ -15,6 +16,10 @@ func GetAPIKey(headers http.Header) (string, error) { return "", ErrNoAuthHeaderIncluded } splitAuth := strings.Split(authHeader, " ") + fmt.Println("SPLIT AUTH") + fmt.Println(splitAuth) + fmt.Println(len(splitAuth)) + fmt.Println(len(splitAuth[0])) if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { return "", errors.New("malformed authorization header") } diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go new file mode 100644 index 0000000000..9024ded826 --- /dev/null +++ b/internal/auth/auth_test.go @@ -0,0 +1,33 @@ +package auth + +import ( + "net/http" + "reflect" + "testing" +) + +func TestGetApiKey(t *testing.T) { + var headerTestOne = http.Header{ + "Authorization": []string{"ApiKey 12345-abcde-67890-fghij"}, + } + var headerTestTwo = http.Header{ + "Authorization": []string{"ApiKey "}, + } + type test struct { + input http.Header + want string + } + tests := []test { + {input: headerTestOne, want: "12345-abcde-67890-fghij"}, + {input: headerTestTwo, want: "a"}, + } + for _, tc := range tests { + got, err := GetAPIKey(tc.input) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} \ No newline at end of file From 96c705a6b5278afdfd53c218e203f995c628b33c Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 12:24:45 -0400 Subject: [PATCH 05/30] update ci test --- .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 e2583f2471..d5f1d4fecb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: '1.23.0' - - name: Print Go version - run: go version + - name: Run Tests + run: go test ./internal/auth From 21b694c3f67f19d5abe3b7f1588ec3b04815acf1 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 12:27:46 -0400 Subject: [PATCH 06/30] updated test code --- internal/auth/auth_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index 9024ded826..f9da95a521 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -19,7 +19,7 @@ func TestGetApiKey(t *testing.T) { } tests := []test { {input: headerTestOne, want: "12345-abcde-67890-fghij"}, - {input: headerTestTwo, want: "a"}, + {input: headerTestTwo, want: ""}, } for _, tc := range tests { got, err := GetAPIKey(tc.input) From a92e06171e8475bdaa4bc159c5be38c501e38833 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 12:42:56 -0400 Subject: [PATCH 07/30] Added coverage --- .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 d5f1d4fecb..d9542d0685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: '1.23.0' - name: Run Tests - run: go test ./internal/auth + run: go test ./internal/auth -cover From 5fd01540aade260406e03ab7a671a994dd5c63e2 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 12:54:17 -0400 Subject: [PATCH 08/30] added test badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b8f857ea74..48f01ee50c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![alt text goes here](https://github.com/WilliamBadgett97/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 26f78603f34ff734b5b98d2f745d88f9a03f9781 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 13:56:32 -0400 Subject: [PATCH 09/30] Added fmt job --- .github/workflows/ci.yml | 3 +++ internal/auth/auth_test.go | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9542d0685..0b17b6efa7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,6 @@ jobs: - name: Run Tests run: go test ./internal/auth -cover + + - name: Style + run: test -z $(go fmt ./...) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index f9da95a521..9544870260 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -14,10 +14,10 @@ func TestGetApiKey(t *testing.T) { "Authorization": []string{"ApiKey "}, } type test struct { - input http.Header - want string - } - tests := []test { + input http.Header + want string + } + tests := []test{ {input: headerTestOne, want: "12345-abcde-67890-fghij"}, {input: headerTestTwo, want: ""}, } @@ -27,7 +27,7 @@ func TestGetApiKey(t *testing.T) { t.Fatal(err) } if !reflect.DeepEqual(tc.want, got) { - t.Fatalf("expected: %v, got: %v", tc.want, got) - } + t.Fatalf("expected: %v, got: %v", tc.want, got) + } } -} \ No newline at end of file +} From cf51a708f92df89246914844edb58bb95c20868b Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 14:07:53 -0400 Subject: [PATCH 10/30] updated ci jobs --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b17b6efa7..004a77b47d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,5 +21,18 @@ jobs: - name: Run Tests run: go test ./internal/auth -cover - - name: Style + style: + name: Style + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23.0' + + - name: Check Formatting run: test -z $(go fmt ./...) From 6fc18f440517b4f1ac20211d9af51427742e564e Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 14:54:59 -0400 Subject: [PATCH 11/30] added staticcheck --- .github/workflows/ci.yml | 3 +++ main.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 004a77b47d..887eff7b49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,3 +36,6 @@ jobs: - name: Check Formatting run: test -z $(go fmt ./...) + + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest diff --git a/main.go b/main.go index 19d7366c5f..82d38d9d1d 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,11 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) +func unused() { + // this function does nothing + // and is called nowhere +} + type apiConfig struct { DB *database.Queries } From cc639ab4426774850e2b20cfa97fe6deecf48bd3 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 15:17:10 -0400 Subject: [PATCH 12/30] Remove unused function --- main.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.go b/main.go index 82d38d9d1d..c1ab29f94b 100644 --- a/main.go +++ b/main.go @@ -17,10 +17,6 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) -func unused() { - // this function does nothing - // and is called nowhere -} type apiConfig struct { DB *database.Queries From df968c93610cdf7e7a00e3f967940a9f7f278548 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 15:18:12 -0400 Subject: [PATCH 13/30] Remove unused function --- .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 887eff7b49..64c56a1f1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,6 @@ jobs: - name: Check Formatting run: test -z $(go fmt ./...) - + - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest + run: go install honnef.co/go/tools/cmd/staticcheck@latest From ecf6d440178b1e1932b32dc3ef796e34e490b1ec Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 15:43:06 -0400 Subject: [PATCH 14/30] formatted --- main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/main.go b/main.go index c1ab29f94b..19d7366c5f 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,6 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) - type apiConfig struct { DB *database.Queries } From 491e46ff066955cc55206e41c58b6aaec8671d77 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 21:51:23 -0400 Subject: [PATCH 15/30] added gosec security checking --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64c56a1f1a..2f4847111b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: - name: Run Tests run: go test ./internal/auth -cover + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest style: name: Style From 19a6d2583217a77c28a97ca30ef74ac8e2f94bb8 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 21:54:36 -0400 Subject: [PATCH 16/30] . --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f4847111b..2a83aba02c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: - name: Run Tests run: go test ./internal/auth -cover + - name: Install gosec run: go install github.com/securego/gosec/v2/cmd/gosec@latest From 120851c7bd9a51c5f7f2b774f8d2183d10167a0e Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 21:56:06 -0400 Subject: [PATCH 17/30] Run gosec --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a83aba02c..4a656f678e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - name: Install gosec run: go install github.com/securego/gosec/v2/cmd/gosec@latest + - name: Run gosec + run: gosec ./... + style: name: Style runs-on: ubuntu-latest From 586e6b08682b5a4012d9e56641e57a6cf70d2428 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 22:22:24 -0400 Subject: [PATCH 18/30] Fixed gosec issues --- json.go | 7 ++++++- main.go | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/json.go b/json.go index 1e6e7985e1..35fe788492 100644 --- a/json.go +++ b/json.go @@ -30,5 +30,10 @@ 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 data %s", err) + w.WriteHeader(500) + return + } } diff --git a/main.go b/main.go index 19d7366c5f..7b260066ed 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "log" "net/http" "os" + "time" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -91,6 +92,7 @@ func main() { srv := &http.Server{ Addr: ":" + port, Handler: router, + ReadHeaderTimeout: time.Second * 5, } log.Printf("Serving on port: %s\n", port) From 775ecf9e49419fd04091f597a601737f25b2dae5 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 22:26:36 -0400 Subject: [PATCH 19/30] formatted --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 7b260066ed..ec86bb7bf9 100644 --- a/main.go +++ b/main.go @@ -90,8 +90,8 @@ func main() { router.Mount("/v1", v1Router) srv := &http.Server{ - Addr: ":" + port, - Handler: router, + Addr: ":" + port, + Handler: router, ReadHeaderTimeout: time.Second * 5, } From 3af10d44440da178cfbbb068a3b84eb2f3ec2716 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 23:49:25 -0400 Subject: [PATCH 20/30] added cd --- .github/workflows/cd.yml | 28 ++++++++++++++++++++++++++++ json.go | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000000..c467514b8d --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,28 @@ +name: cd +on: + push: + branches: [main] + +jobs + deploy: + name: deploy + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Set up go + uses: actions/setup-go@v2 + with: + go-version: "1.20" + + - name: Check out repository + uses: action/checkout@v2 + + - name: Build + run: scripts/buildprod.sh + + +# It should have a single job called Deploy +# It should checkout the code +# It should set up the Go toolchain +# It should build the app using the scripts/buildprod.sh script diff --git a/json.go b/json.go index 35fe788492..7267a6cb62 100644 --- a/json.go +++ b/json.go @@ -37,3 +37,5 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } } + + From 9728216acaed4658fae8352688f3fc796352f371 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 23:50:29 -0400 Subject: [PATCH 21/30] formatting --- json.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/json.go b/json.go index 7267a6cb62..35fe788492 100644 --- a/json.go +++ b/json.go @@ -37,5 +37,3 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } } - - From 0eeeaef85e5a63a45c1e0f923b40f2bf805b082d Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 23:52:15 -0400 Subject: [PATCH 22/30] Removed unneeded comments --- .github/workflows/cd.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c467514b8d..009a50d98e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,9 +20,3 @@ jobs - name: Build run: scripts/buildprod.sh - - -# It should have a single job called Deploy -# It should checkout the code -# It should set up the Go toolchain -# It should build the app using the scripts/buildprod.sh script From e53ef475b8b93b15f98d8cb75fba0812aa1adcdd Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 23:56:05 -0400 Subject: [PATCH 23/30] fixed cd --- .github/workflows/cd.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 009a50d98e..f7f1c78913 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -3,20 +3,20 @@ on: push: branches: [main] -jobs +jobs: deploy: - name: deploy - runs-on: ubuntu-latest - timeout-minutes: 30 + name: deploy + runs-on: ubuntu-latest + timeout-minutes: 30 - steps: - - name: Set up go - uses: actions/setup-go@v2 - with: - go-version: "1.20" - - - name: Check out repository - uses: action/checkout@v2 - - - name: Build - run: scripts/buildprod.sh + steps: + - name: Set up go + uses: actions/setup-go@v2 + with: + go-version: '1.20' + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Build + run: scripts/buildprod.sh From 29c83345a513154f531296b190d895fea665ece1 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sat, 12 Apr 2025 23:59:50 -0400 Subject: [PATCH 24/30] Updated go version in cd --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f7f1c78913..0dd0e3346f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -13,7 +13,7 @@ jobs: - name: Set up go uses: actions/setup-go@v2 with: - go-version: '1.20' + go-version: '1.22' - name: Check out repository uses: actions/checkout@v2 From f42af56e4039100474bc1c2c8b1f3a19a78765ad Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sun, 13 Apr 2025 00:04:33 -0400 Subject: [PATCH 25/30] updated CD job name --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0dd0e3346f..47d1f6dbb1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,7 +5,7 @@ on: jobs: deploy: - name: deploy + name: Deploy runs-on: ubuntu-latest timeout-minutes: 30 From 75be89ae74ebb472300aba605e45ae1a303b5401 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sun, 13 Apr 2025 22:20:19 -0400 Subject: [PATCH 26/30] cd updates --- .github/workflows/cd.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 47d1f6dbb1..3900bb3825 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,3 +20,12 @@ jobs: - name: Build run: scripts/buildprod.sh + + - 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: + version: '>= 363.0.0' From 1107c0d5e2a4009c09b9e34881d73a7ec110119f Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sun, 13 Apr 2025 22:42:49 -0400 Subject: [PATCH 27/30] updated cd process --- .github/workflows/cd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3900bb3825..59dd962464 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -24,8 +24,10 @@ jobs: - id: 'auth' 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@v2' with: version: '>= 363.0.0' + - name: Build and push Docker image + run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-456712/notely-ar-repo/my-image:1.0.0 . From b83aae6d81aa79f3410242326da72a9e7d2039d0 Mon Sep 17 00:00:00 2001 From: William Badgett Date: Sun, 13 Apr 2025 23:49:27 -0400 Subject: [PATCH 28/30] updated cd --- .github/workflows/cd.yml | 2 + static/index.html | 354 ++++++++++++++++++++------------------- 2 files changed, 184 insertions(+), 172 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 59dd962464..fc1d6df37e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -31,3 +31,5 @@ jobs: version: '>= 363.0.0' - name: Build and push Docker image run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-456712/notely-ar-repo/my-image:1.0.0 . + - name: Deploy to Cloud Run + run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-456712/notely-ar-repo/my-image:1.0.0 . --region us-central1 --allow-unauthenticated --project notely-456712 --max-instances=4 diff --git a/static/index.html b/static/index.html index 72be101028..dcc7bb0410 100644 --- a/static/index.html +++ b/static/index.html @@ -1,193 +1,203 @@ - - - + + Notely - + - -

Notely

+ +

Welcome to Notely

- - + +
-