Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
53 changes: 53 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CD

on:
push:
branches: [main]

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

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

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install goose
run: go install github.com/pressly/goose/v3/cmd/goose@latest

- name: Build production binary
run: ./scripts/buildprod.sh

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

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

- name: Build and push Docker image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-483516/notely-ar-repo/notely-app:latest .

- name: Run database migrations
run: ./scripts/migrateup.sh

- name: Deploy to Cloud Run
run: |
gcloud run deploy notely \
--image us-central1-docker.pkg.dev/notely-483516/notely-ar-repo/notely-app:latest \
--region us-central1 \
--allow-unauthenticated \
--project notely-483516 \
--max-instances=4
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Yaroslav's version of Boot.dev's Notely app.
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>

<body class="section">
<h1>Notely</h1>
<h1>Welcome to Notely</h1>

<div id="userCreationContainer" class="section">
<input id="nameField" type="text" placeholder="Enter your name">
Expand Down Expand Up @@ -190,4 +190,4 @@ <h2>Your Notes</h2>
<!-- your existing CSS code... -->
</body>

</html>
</html>