Skip to content
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
16 changes: 14 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,35 @@ jobs:
update:
name: Update
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
with:
install_components: gke-gcloud-auth-plugin
- name: Install Packages
working-directory: ./pulumi
run: npm install
- name: TypeScript Check
working-directory: ./pulumi
run: npm run check
- name: Authenticate Pulumi
uses: pulumi/auth-actions@v1
with:
organization: meiermade
requested-token-type: urn:pulumi:token-type:access_token:personal
scope: user:meiermade
- name: Update
uses: pulumi/actions@v6
with:
work-dir: ./pulumi
command: up
stack-name: prod
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
13 changes: 11 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
with:
install_components: gke-gcloud-auth-plugin
- name: Install Packages
working-directory: ./pulumi
run: npm install
- name: TypeScript Check
working-directory: ./pulumi
run: npm run check
- name: Authenticate Pulumi
uses: pulumi/auth-actions@v1
with:
organization: meiermade
requested-token-type: urn:pulumi:token-type:access_token:personal
scope: user:meiermade
- name: Preview
uses: pulumi/actions@v6
with:
Expand All @@ -50,5 +61,3 @@ jobs:
stack-name: prod
diff: true
comment-on-pr: true
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
6 changes: 2 additions & 4 deletions app/src/App/src/Config.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ open Domain
open System

type SeqConfig =
{ endpoint:string
apiKey:string }
{ endpoint:string }

module SeqConfig =
let load () =
{ endpoint = Env.variableOrDefault "SEQ_ENDPOINT" "http://localhost:5341"
apiKey = Env.variableOrDefault "SEQ_API_KEY" "" }
{ endpoint = Env.variableOrDefault "SEQ_ENDPOINT" "http://localhost:5341" }

type ServerConfig =
{ url:string }
Expand Down
5 changes: 2 additions & 3 deletions app/src/App/src/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ let configureTracerProvider (config: Config) =
.AddHttpClientInstrumentation()
.AddOtlpExporter(fun opts ->
opts.Endpoint <- Uri(config.seq.endpoint + "/ingest/otlp/v1/traces")
opts.Protocol <- OtlpExportProtocol.HttpProtobuf
opts.Headers <- $"X-Seq-ApiKey={config.seq.apiKey}")
opts.Protocol <- OtlpExportProtocol.HttpProtobuf)
.Build()

let configureLogger (config: Config) =
Expand All @@ -39,7 +38,7 @@ let configureLogger (config: Config) =
LoggerConfiguration()
.MinimumLevel.ControlledBy(levelSwitch)
.WriteTo.Console()
.WriteTo.Seq(serverUrl = config.seq.endpoint, apiKey = config.seq.apiKey, controlLevelSwitch = levelSwitch)
.WriteTo.Seq(serverUrl = config.seq.endpoint, controlLevelSwitch = levelSwitch)
.CreateLogger()

Log.Logger <- logger
Expand Down
6 changes: 3 additions & 3 deletions app/src/Domain/Notion.fs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ module Cursor =

type Config =
{ articlesDatabaseId:DatabaseId
token:string }
apiKey:string }

module Config =
let load () =
{ articlesDatabaseId = Env.variable "NOTION_ARTICLES_DATABASE_ID" |> DatabaseId.ofString
token = Env.variable "NOTION_TOKEN" }
apiKey = Env.variable "NOTION_API_KEY" }

// ============================================================
// Types
Expand Down Expand Up @@ -359,7 +359,7 @@ let private BaseUrl = "https://api.notion.com/v1"

let private createRequest (config: Config) (method: HttpMethod) (url: string) =
let req = new HttpRequestMessage(method, url)
req.Headers.Authorization <- AuthenticationHeaderValue("Bearer", config.token)
req.Headers.Authorization <- AuthenticationHeaderValue("Bearer", config.apiKey)
req.Headers.Add("Notion-Version", NotionApiVersion)
req

Expand Down
2 changes: 1 addition & 1 deletion app/src/Tests/ArticleServiceTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let private telemetry () =

let private notionConfig: Notion.Config =
{ articlesDatabaseId = Notion.DatabaseId.ofString "db"
token = "token" }
apiKey = "token" }

let private emptyNotionService: Notion.Service =
{ queryDatabase =
Expand Down
2 changes: 1 addition & 1 deletion app/src/Tests/NotionServiceTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let private mockHttpClient (responses: (string * string) list) =

let private testConfig: Config =
{ articlesDatabaseId = DatabaseId.ofString "articles-db"
token = "test-token" }
apiKey = "test-token" }

let private noopTelemetry: Telemetry.Service =
{ startActiveSpan =
Expand Down
1 change: 0 additions & 1 deletion pulumi/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './src/aws'
import './src/cloudflare'
import './src/docker'
import './src/k8s'
Loading
Loading