Skip to content

Commit

Permalink
Merge pull request #1 from bootdotdev/lw_gcp
Browse files Browse the repository at this point in the history
cicd
  • Loading branch information
wagslane authored Jan 3, 2024
2 parents 50dfca6 + bb0355b commit ec542ac
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 19 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: cd

on:
push:
branches: [main]

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

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Check out code
uses: actions/checkout@v3

- name: Build app
run: make

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

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'Build and push Docker image'
run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/learntocodefyi-prod/learntocodefyi-ar-repo/learntocodefyi:latest .'

- name: 'Deploy to Cloud Run'
run: 'gcloud run deploy learntocodefyi --image us-central1-docker.pkg.dev/learntocodefyi-prod/learntocodefyi-ar-repo/learntocodefyi:latest --region us-central1 --allow-unauthenticated --project learntocodefyi-prod'
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ci

on:
pull_request:
branches: [main]

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

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v3

- name: Run unit tests
run: go test ./... -cover
17 changes: 0 additions & 17 deletions fly.toml

This file was deleted.

4 changes: 2 additions & 2 deletions internal/sendgridwrap/sendgrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
)

const (
LearnToCodeFYIListID = "d9b0b0c0-5b0a-4b0a-9b0a-0b0a0b0a0b0a"
LearnToCodeFYIListID = "ca9ecbeb-2741-4365-9e5e-600058798398"
)

// Client -
Expand All @@ -33,7 +33,7 @@ func NewClient(apiKey, platform string) Client {

// SendMagicLink -
func (c Client) SendMagicLink(toEmail, toName, loginLink string) error {
const templateID = "d-a8edcea9806b4cdbbb72ff85b8efd93c"
const templateID = "d-6e010242fdb54c819d93ce43f0e3a51c"
const fromEmail = "[email protected]"
const fromName = "LearnToCode.fyi"

Expand Down

0 comments on commit ec542ac

Please sign in to comment.