Skip to content

Commit 39b92b9

Browse files
v3 effort (#158)
* SQL Database (#157) * point zoekt to v3 branch * bump zoekt version * Add tenant ID concept into web app and backend (#160) * hacked together a example of using zoekt grpc api * provide tenant id to zoekt git indexer * update zoekt version to point to multitenant branch * pipe tenant id through header to zoekt * remove incorrect submodule reference and settings typo * update zoekt commit * remove unused yarn script * remove unused grpc client in web server * remove unneeded deps and improve tenant id log * pass tenant id when creating repo in db * add mt yarn script * add nocheckin comment to tenant id in v2 schema --------- Co-authored-by: bkellam <bshizzle1234@gmail.com> * bump zoekt version * parallelize repo indexing (#163) * hacked together a example of using zoekt grpc api * provide tenant id to zoekt git indexer * update zoekt version to point to multitenant branch * pipe tenant id through header to zoekt * remove incorrect submodule reference and settings typo * update zoekt commit * remove unused yarn script * remove unused grpc client in web server * remove unneeded deps and improve tenant id log * pass tenant id when creating repo in db * add mt yarn script * add pol of bullmq into backend * add better error handling and concurrency setting * spin up redis instance in dockerfile * cleanup transaction logic when adding repos to index queue * add NEW index status fetch condition * move bullmq deps to backend --------- Co-authored-by: bkellam <bshizzle1234@gmail.com> * Authentication (#164) * Add Org table (#167) * Move logout button & profile picture into settings dropdown (#172) * Multi tenancy support in config syncer (#171) * [wip] initial mt support in config syncer * Move logout button & profile picture into settings dropdown (#172) * update sync status properly and fix bug with multiple config in db case * make config path required in single tenant mode NOTE: deleting config/repos is currently not supported in multi tenancy case. Support for this will be added in a future PR --------- Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com> * add tenant mode support in docker container: * Organization switching & active org management (#173) * updated syncedAt date after config sync: * Migrate to postgres (#174) * spin up postgres in docker container * get initial pol of postgres db working in docker image * spin up postgres server in dev case * updated syncedAt date after config sync: * remove unnecessary port expose in docker file * Connection creation form (#175) * fix issue with yarn dev startup * init (#176) * Add `@sourcebot/schemas` package (#177) * Connection management (#178) * add concept of secrets (#180) * add @sourcebot/schemas package * migrate things to use the schemas package * Dockerfile support * add secret table to schema * Add concept of connection manager * Rename Config->Connection * Handle job failures * Add join table between repo and connection * nits * create first version of crypto package * add crypto package as deps to others * forgot to add package changes * add server action for adding and listing secrets, create test page for it * add secrets page to nav menu * add secret to config and support fetching it in backend * reset secret form on successful submission * add toast feedback for secrets form * add instructions for adding encryption key to dev instructions * add encryption key support in docker file * add delete secret button * fix nits from pr review --------- Co-authored-by: bkellam <bshizzle1234@gmail.com> * bump zoekt version * enforce tenancy on search and repo listing endpoints (#181) * enforce tenancy on search and repo listing * remove orgId from request schemas * adds garbage collection for repos (#182) * refactor repo indexing logic into RepoManager * wip cleanup stale repos * add rest of gc logic * set status to indexing properly * add initial logic for staging environment * try to move encryption key env decleration in docker file to fix build issues * switch encryption key as build arg to se if that fixes build issues * add deployment action for staging image * try using mac github action runners instead * switch to using arm64 runners on arm64 build * change workflow names to fix trigger issue * trigger staging actions to see if it works * fix working directory typo and pray it doesnt push to prod * checkout v3 when deploying staging * try to change into the staging dir manuall * dummy commit to trigger v3 workflows to test * update staging deploy script to match new version in main * reference proper image:tag in staging fly config * update staging fly config to point to ghcr * Connection management (#183) * add invite system and google oauth provider (#185) * add settings page with members list * add invite to schema and basic create form * add invite table * add basic invite link copy button * add auth invite accept case * add non auth logic * add google oauth provider * fix reference to header component in connections * add google logo to google oauth * fix web build errors * bump staging resources * change staging cpu to perf * add side bar nav in settings page * improve styling of members page * wip adding stripe checkout button * wip onboarding flow * add stripe subscription id to org * save stripe session id and add manage subscription button in settings * properly block access to pages if user isn't in an org * wip add paywall * Domain support * Domain support (#188) * Update Makefile to include crypto package when doing a make clean * Add default for AUTH_URL in attempt to fix build * attempt 2 * fix attempt #3: Do not require a encrpytion key at build time * Fix generate script race condition * Attempt #4 * add back paywall and also add support for incrememnting seat count on invite redemption * prevent self invite * action button styling in settings and toast on copy * add ability to remove member from org * move stripe product id to env var * add await for blocking loop in backend * add subscription info to billing page * handle trial case in billing info page * add trial duration indicator to nav bar * check if domain starts or ends with dash * remove unused no org component * Generate AUTH_SECRET if not provided (#189) * remove package lock file and fix prisma dep version * revert dep version updates * fix yarn.lock * add auth and membership check to fetchSubscription * properly handle invite redeem with no valid subscription case * change back fetch subscription to not require org membership * add back subscription check in invite redeem page * Add stripe billing logic (#190) * add side bar nav in settings page * improve styling of members page * wip adding stripe checkout button * wip onboarding flow * add stripe subscription id to org * save stripe session id and add manage subscription button in settings * properly block access to pages if user isn't in an org * wip add paywall * Domain support * add back paywall and also add support for incrememnting seat count on invite redemption * prevent self invite * action button styling in settings and toast on copy * add ability to remove member from org * move stripe product id to env var * add await for blocking loop in backend * add subscription info to billing page * handle trial case in billing info page * add trial duration indicator to nav bar * check if domain starts or ends with dash * remove unused no org component * remove package lock file and fix prisma dep version * revert dep version updates * fix yarn.lock * add auth and membership check to fetchSubscription * properly handle invite redeem with no valid subscription case * change back fetch subscription to not require org membership * add back subscription check in invite redeem page --------- Co-authored-by: bkellam <bshizzle1234@gmail.com> * fix nits * remove providers check * fix more nits * change stripe init to be behind function * fix publishible stripe key handling in docker container * enforce owner perms (#191) * add make owner logic, and owner perms for removal, invite, and manage subscription * add change billing email card to billing settings * enforce owner role in action level * remove unused hover card component * cleanup * add back gitlab, gitea, and gerrit support (#184) * add non github config definitions * refactor github config compilation to seperate file * add gitlab config compilation * Connection management (#183) * wip gitlab repo sync support * fix gitlab zoekt metadata * add gitea support * add gerrit support * Connection management (#183) * add gerrit config compilation * Connection management (#183) --------- Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com> * fix apos usage in redeem page * change csrf cookie to secure not host * Credentials provider (#192) * email password functionality * feedback * cleanup org's repos and shards if it's inactive (#194) * add stripe subscription status and webhook * add inactive org repo cleanup logic * mark reactivated org connections for sync * connections qol improvements (#195) * add client side polling to connections list * properly fetch repo image url * add client polling to connection management page, and add ability to sync failed connections * Fix build with suspense boundary * improved fix * add retries for 429 issues (#196) * add connection compile retry and hard repo limit * add more retry checks * cleanup unused change * address feedback * fix build errors and add index concurrency env var * add config upsert timeout env var * Membership settings rework (#198) * Add refined members list * futher progress on members settings polish * Remove old components * feedback * Magic links (#199) * wip on magic link support * Switch to nodemailer / resend for transactional mail * Further cleanup * Add stylized email using react-email * fix * Fix build * db performance improvements and job resilience (#200) * replace upsert with seperate create many and raw update many calls * add bulk repo status update and queue addition with priority * add support for managed redis * add note for changing raw sql on schema change * remove non secret token options * fix token examples in schema * add better visualization for connection/repo errors and warnings (#201) * replace upsert with seperate create many and raw update many calls * add bulk repo status update and queue addition with priority * add support for managed redis * add note for changing raw sql on schema change * add error package and use BackendException in connection manager * handle connection failure display on web app * add warning banner for not found orgs/repos/users * add failure handling for gerrit * add gitea notfound warning support * add warning icon in connections list * style nits * add failed repo vis in connections list * added retry failed repo index buttons * move nav indicators to client with polling * fix indicator flash issue and truncate large list results * display error nav better * truncate failed repo list in connection list item * fix merge error * fix merge bug * add connection util file [wip] * refactor notfound fetch logic and add missing error package to dockerfile * move repeated logic to function and add zod schema for syncStatusMetadata * add orgid unique constraint to repo * revert repo compile update logic to upsert loop * log upsert stats * [temp] disable polling everywhere (#205) * add health check endpoint * Refined onboarding flow (#202) * Redeem UX pass (#204) * add log for health check * fix new connection complete callback route * add cpu split logic and only wait for postgres if we're going to connec to it * Inline secret creation (#207) * use docker scopes to try and improve caching * Dummy change * remove cpu split logic * Add some instrumentation to web * add posthog events on various user actions (#208) * add page view event support * add posthog events * nit: remove unused import * feedback * fix merge error * use staging posthog papik when building staging image * fix other merge error and build warnings * Add invite email (#209) * wrap posthog provider in suspense to fix build error * add grafana alloy config and setup (#210) * add grafana alloy config and setup * add basic repo prom metrics * nits in dockerfile * remove invalid characters when auto filling domain * add login posthog events * remove hard coded sourcebot.app references * make repo garbage collection async (#211) * add gc queue logic * fix missing switch cases for gc status * style org create form better with new staging domain * change repo rm logic to be async * simplify repo for inactive org query * add grace period for garbage collecting repos * make prom scrape interval 500ms * fix typo in trial card * onboarding tweaks * rename some prom metrics and cleanup unused * wipe existing repo if we've picked up a killed job to ensure good state * Connections UX pass + query optimizations (#212) * remove git & local schemas (#213) * skip stripe checkout for trial + fix indexing in progress UI + additional schema validation (#214) * add additional config validation * wip bypass stripe checkout for trial * fix stripe trial checkout bypass * fix indexing in progress ui on home page * add subscription checks, more schema validation, and fix issue with complete page * dont display if no indexed repos * fix skipping onboard complete check * fix build error * add back button in onboard connection creation flow * Add back revision support (#215) * fix build * Fix bug with repository snapshot * fix share links * fix repo rm issue, 502 page, condition on test clock * Make login and onboarding mobile friendly * fix ordering of quick actions * remove error msg dump on failed repo index job, and update indexedAt field * Add mobile unsupported splash screne * cherry pick fix for file links * [Cherry Pick] Syntax reference guide (#169) (#216) * Add .env to db gitignore * fix case where we have repos but they're all failed for repo snapshot * /settings/secrets page (#217) * display domain properly in org create form * Quick action tweaks (#218) * revamp repo page (#220) * wip repo table * new repo page * add indicator for when feedback is applied in repo page * add repo button * fetch connection data in one query * fix styling * fix (#219) * remove / keyboard shortcut hint in search bar * prevent switching to first page on data update and truncate long repo names in repo list * General settings + cleanup (#221) * General settings * Add alert to org domain change * First attempt at sending logs to grafana * logs wip * add alloy logs * wip * [temp] comment out loki for now * update trial card content and add events for code host selection on onboard * reduce scraping interval to 15s * Add prometheus metric for pending repo indexing jobs * switch magic link to invite code (#222) * wip magic link codes * pipe email to email provider properly * remove magic link data cookie after sign in * clean up unused imports * dont remove cookie before we use it * rm package-lock.json * revert yarn files to v3 state * switch email passing from cookie to search param * add comment for settings dropdown auth update * remove unused middleware file * fix build error and warnings * fix build error with useSearchParam not wrapped in suspense * add sentry support to backend and webapp (#223) * add sentry to web app * set sentry environemnt from env var * add sentry env replace logic in docker container * wip add backend sentry * add sentry to backend * move dns to env var * remove test exception * Fix root domain issue on onboarding * add setup sentry cli step to github action * login to sentry * fix sentry login in action * Update grafana loki endpoint * switch source map publish to runtime in entrypoint * catch and rethrow simplegit exceptions * alloy nits * fix alloy * backend logging (#224) * revert grafana loki config * fix login ui nits * fix quick actions * fix typo in secret creation * fix private repo clone issue for gitlab * add repo index timeout logic * add posthog identify call after registeration * various changes to add terms and security info (#225) * add terms and security to footer * add security card * add demo card * fix build error * nit fix: center 'get in touch' on security card * Dark theme improvements (#226) * (fix) Fixed bug with gitlab and gitea not including hostname in the repoName * Switch to using t3-env for env-var management (#230) * Add missing env var * fix build * Centralize to using a single .env.development for development workflows (#231) * Make billing optional (#232) * Massage environment variables from strings to numbers (#234) * Single tenancy & auth modes (#233) * Add docs to this repo * dummy change * Declarative connection configuration (#235) * fix build * upgrade to next 14.2.25 * Improved database DX * migrate to yarn v4 * Use origin from header for baseUrl of emails (instead of AUTH_URL). Also removed reference to hide scrollbars * Remove SOURCEBOT_ENCRYPTION_KEY from build arg * Fix issue with linking default user to org in single tenant + no-auth mode * Fix fallback tokens (#242) * add SECURITY_CARD_ENABLED flag * Add repository weburl (#243) * Random fixes and improvements (#244) * add zoekt max wall time env var * remove empty warning in docs * fix reference in sh docs * add connection manager upsert timeout env var * Declarative connection cleanup + improvements (#245) * change contact us footer in app to point to main contact form * PostHog event pass (#246) * fix typo * Add sourcebot cloud environment prop to staging workflow * Update generated files * remove AUTH_URL since it unused and (likely) unnecessary * Revert "remove AUTH_URL since it unused and (likely) unnecessary" This reverts commit 1f4a5ae. * cleanup GitHub action releases (#252) * remove alloy, change auth defaul to disabled, add settings page in me dropdown * enforce connection management perms to owner (#253) * enforce conneciton management perms to owner * fix formatting * more formatting * naming nits * fix var name error * change empty repo set copy if auth is disabled * add CONTRIBUTING.md file * hide settings in dropdown with auth isnt enabled * handle case where gerrit weburl is just gitiles path * Docs overhall (#251) * remove nocheckin * fix build error * remove v3 trigger from deploy staging * fix build errors round 2 * another error fix --------- Co-authored-by: msukkari <michael.sukkarieh@mail.mcgill.ca>
1 parent 2b28c11 commit 39b92b9

File tree

398 files changed

+43311
-10285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+43311
-10285
lines changed

.dockerignore

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Dockerfile
22
.dockerignore
3-
node_modules
43
npm-debug.log
54
README.md
6-
.next
7-
!.next/static
8-
!.next/standalone
95
.git
106
.sourcebot
11-
.env.local
7+
packages/web/.next
8+
!packages/web/.next/static
9+
!packages/web/.next/standalone
10+
**/node_modules
11+
**/.env.local
12+
**/.sentryclirc
13+
**/.env.sentry-build-plugin
14+
.yarn
15+
!.yarn/releases

.env.development

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
# Prisma
3+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
4+
5+
# Zoekt
6+
ZOEKT_WEBSERVER_URL="http://localhost:6070"
7+
# SHARD_MAX_MATCH_COUNT=10000
8+
# TOTAL_MAX_MATCH_COUNT=100000
9+
# The command to use for generating ctags.
10+
CTAGS_COMMAND=ctags
11+
# logging, strict
12+
SRC_TENANT_ENFORCEMENT_MODE=strict
13+
14+
# Auth.JS
15+
# You can generate a new secret with:
16+
# openssl rand -base64 33
17+
# @see: https://authjs.dev/getting-started/deployment#auth_secret
18+
AUTH_SECRET="00000000000000000000000000000000000000000000"
19+
AUTH_URL="http://localhost:3000"
20+
# AUTH_CREDENTIALS_LOGIN_ENABLED=true
21+
# AUTH_GITHUB_CLIENT_ID=""
22+
# AUTH_GITHUB_CLIENT_SECRET=""
23+
# AUTH_GOOGLE_CLIENT_ID=""
24+
# AUTH_GOOGLE_CLIENT_SECRET=""
25+
26+
# Email
27+
# EMAIL_FROM_ADDRESS="" # The from address for transactional emails.
28+
# SMTP_CONNECTION_URL="" # The SMTP connection URL for transactional emails.
29+
30+
# PostHog
31+
# POSTHOG_PAPIK=""
32+
# NEXT_PUBLIC_POSTHOG_PAPIK=""
33+
34+
# Sentry
35+
# SENTRY_BACKEND_DSN=""
36+
# NEXT_PUBLIC_SENTRY_WEBAPP_DSN=""
37+
# SENTRY_ENVIRONMENT="dev"
38+
# NEXT_PUBLIC_SENTRY_ENVIRONMENT="dev"
39+
# SENTRY_AUTH_TOKEN=
40+
41+
# Logtail
42+
# LOGTAIL_TOKEN=""
43+
# LOGTAIL_HOST=""
44+
45+
# Redis
46+
REDIS_URL="redis://localhost:6379"
47+
48+
# Stripe
49+
# STRIPE_SECRET_KEY: z.string().optional(),
50+
# STRIPE_PRODUCT_ID: z.string().optional(),
51+
# STRIPE_WEBHOOK_SECRET: z.string().optional(),
52+
# STRIPE_ENABLE_TEST_CLOCKS=false
53+
54+
# Misc
55+
56+
# Generated using:
57+
# openssl rand -base64 24
58+
SOURCEBOT_ENCRYPTION_KEY="00000000000000000000000000000000"
59+
60+
SOURCEBOT_LOG_LEVEL="debug" # valid values: info, debug, warn, error
61+
SOURCEBOT_TELEMETRY_DISABLED=true # Disables telemetry collection
62+
63+
# Code-host fallback tokens
64+
# FALLBACK_GITHUB_CLOUD_TOKEN=""
65+
# FALLBACK_GITLAB_CLOUD_TOKEN=""
66+
# FALLBACK_GITEA_CLOUD_TOKEN=""
67+
68+
# Controls the number of concurrent indexing jobs that can run at once
69+
# INDEX_CONCURRENCY_MULTIPLE=
70+
71+
# Controls the polling interval for the web app
72+
# NEXT_PUBLIC_POLLING_INTERVAL_MS=
73+
74+
# Controls the version of the web app
75+
# NEXT_PUBLIC_SOURCEBOT_VERSION=
76+
77+
# CONFIG_MAX_REPOS_NO_TOKEN=
78+
# NODE_ENV=
79+
# SOURCEBOT_TENANCY_MODE=single
80+
81+
# NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=

.github/workflows/_gcp-deploy.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: GCP Deploy
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
description: 'The environment to deploy to'
9+
type: string
10+
11+
jobs:
12+
gcp-deploy:
13+
runs-on: ubuntu-latest
14+
environment: ${{ inputs.environment }}
15+
env:
16+
IMAGE_PATH: us-west1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/sourcebot/sourcebot-${{ vars.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT }}
17+
steps:
18+
- name: 'Checkout'
19+
uses: 'actions/checkout@v3'
20+
with:
21+
submodules: "true"
22+
23+
# @see: https://github.com/google-github-actions/auth?tab=readme-ov-file#direct-wif
24+
- name: 'Google auth'
25+
id: 'auth'
26+
uses: 'google-github-actions/auth@v2'
27+
with:
28+
project_id: '${{ secrets.GCP_PROJECT_ID }}'
29+
workload_identity_provider: '${{ secrets.GCP_WIF_PROVIDER }}'
30+
31+
- name: 'Set up Cloud SDK'
32+
uses: 'google-github-actions/setup-gcloud@v1'
33+
with:
34+
project_id: '${{ secrets.GCP_PROJECT_ID }}'
35+
36+
- name: 'Docker auth'
37+
run: |-
38+
gcloud auth configure-docker us-west1-docker.pkg.dev
39+
40+
- name: Configure SSH
41+
run: |
42+
mkdir -p ~/.ssh/
43+
echo "${{ secrets.GCP_SSH_PRIVATE_KEY }}" > ~/.ssh/private.key
44+
chmod 600 ~/.ssh/private.key
45+
echo "${{ secrets.GCP_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
46+
47+
- name: Build Docker image
48+
id: build
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
push: true
53+
tags: |
54+
${{ env.IMAGE_PATH }}:${{ github.sha }}
55+
${{ env.IMAGE_PATH }}:latest
56+
build-args: |
57+
NEXT_PUBLIC_SOURCEBOT_VERSION=${{ github.ref_name }}
58+
NEXT_PUBLIC_POSTHOG_PAPIK=${{ vars.NEXT_PUBLIC_POSTHOG_PAPIK }}
59+
NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=${{ vars.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT }}
60+
NEXT_PUBLIC_SENTRY_ENVIRONMENT=${{ vars.NEXT_PUBLIC_SENTRY_ENVIRONMENT }}
61+
NEXT_PUBLIC_SENTRY_WEBAPP_DSN=${{ vars.NEXT_PUBLIC_SENTRY_WEBAPP_DSN }}
62+
NEXT_PUBLIC_SENTRY_BACKEND_DSN=${{ vars.NEXT_PUBLIC_SENTRY_BACKEND_DSN }}
63+
SENTRY_SMUAT=${{ secrets.SENTRY_SMUAT }}
64+
SENTRY_ORG=${{ vars.SENTRY_ORG }}
65+
SENTRY_WEBAPP_PROJECT=${{ vars.SENTRY_WEBAPP_PROJECT }}
66+
SENTRY_BACKEND_PROJECT=${{ vars.SENTRY_BACKEND_PROJECT }}
67+
68+
69+
- name: Deploy to GCP
70+
run: |
71+
ssh -i ~/.ssh/private.key ${{ secrets.GCP_USERNAME }}@${{ secrets.GCP_HOST }} << 'EOF'
72+
# First pull the new image
73+
docker pull ${{ env.IMAGE_PATH }}:${{ github.sha }}
74+
75+
# Stop and remove any existing container
76+
docker stop -t 60 sourcebot || true
77+
docker rm sourcebot || true
78+
79+
# Run the new container
80+
docker run -d \
81+
-p 80:3000 \
82+
--rm \
83+
--env-file .env \
84+
-v /mnt/data:/data \
85+
--name sourcebot \
86+
${{ env.IMAGE_PATH }}:${{ github.sha }}
87+
EOF

.github/workflows/deploy-prod.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Deploy Prod
2+
3+
on:
4+
push:
5+
tags: ["v*.*.*"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy-prod:
10+
uses: ./.github/workflows/_gcp-deploy.yml
11+
secrets: inherit
12+
permissions:
13+
contents: 'read'
14+
# Requird for OIDC auth with GCP.
15+
# @see: https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
16+
id-token: 'write'
17+
with:
18+
environment: prod

.github/workflows/deploy-staging.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Deploy Staging
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*.*.*"]
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy-staging:
11+
uses: ./.github/workflows/_gcp-deploy.yml
12+
secrets: inherit
13+
permissions:
14+
contents: 'read'
15+
# Requird for OIDC auth with GCP.
16+
# @see: https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
17+
id-token: 'write'
18+
with:
19+
environment: staging

.github/workflows/fly-deploy.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/gcp-deploy-staging.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/ghcr-publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
jobs:
1616
build:
1717
runs-on: ${{ matrix.runs-on}}
18+
environment: oss
1819
permissions:
1920
contents: read
2021
packages: write
@@ -30,8 +31,6 @@ jobs:
3031
- platform: linux/arm64
3132
runs-on: ubuntu-24.04-arm
3233

33-
34-
3534
steps:
3635
- name: Prepare
3736
run: |
@@ -79,8 +78,8 @@ jobs:
7978
platforms: ${{ matrix.platform }}
8079
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true,annotation.org.opencontainers.image.description=Blazingly fast code search
8180
build-args: |
82-
SOURCEBOT_VERSION=${{ github.ref_name }}
83-
POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }}
81+
NEXT_PUBLIC_SOURCEBOT_VERSION=${{ github.ref_name }}
82+
NEXT_PUBLIC_POSTHOG_PAPIK=${{ vars.NEXT_PUBLIC_POSTHOG_PAPIK }}
8483
8584
- name: Export digest
8685
run: |

0 commit comments

Comments
 (0)