Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicd #1

Merged
merged 1 commit into from
Jan 3, 2024
Merged
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
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
Loading