Skip to content

Commit

Permalink
Merge pull request #544 from 0xsend/dev
Browse files Browse the repository at this point in the history
deploy
  • Loading branch information
0xBigBoss authored Jul 4, 2024
2 parents 1df407d + 37d2716 commit 6a914c0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ runs:
sha=$(git rev-parse HEAD | cut -c1-7)
summary=$(git log -1 --pretty=%B | head -n 1)
if [ "${{ inputs.production }}" = "true" ]; then
data=$(printf "New production deployment is available. Summary: %s %s\n\nUnique URL: %s\n\nPublic Hostname: %s" "$summary" "$sha" "${{ steps.vercel-deploy.outputs.deployment-url }}" "https://${{ steps.public-hostname.outputs.public-hostname }}")
data=$(printf "New production deployment is available. Summary: %s %s\n\nUnique URL: <%s>\n\nPublic Hostname: <%s>" "$summary" "$sha" "${{ steps.vercel-deploy.outputs.deployment-url }}" "https://${{ steps.public-hostname.outputs.public-hostname }}")
else
data=$(printf "New staging deployment is available. Summary: %s %s\n\nUnique URL: %s\n\nPublic Hostname: %s" "$summary" "$sha" "${{ steps.vercel-deploy.outputs.deployment-url }}" "https://${{ steps.public-hostname.outputs.public-hostname }}")
data=$(printf "New staging deployment is available. Summary: %s %s\n\nUnique URL: <%s>\n\nPublic Hostname: <%s>" "$summary" "$sha" "${{ steps.vercel-deploy.outputs.deployment-url }}" "https://${{ steps.public-hostname.outputs.public-hostname }}")
fi
curl -X POST -d "$data" "${{ inputs.qa-notification-url }}"
curl -X POST -d "payload={\"text\":\"$data\"}" "${{ inputs.qa-notification-url }}"
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ local_resource(
"playwright:test",
"yarn playwright test",
allow_parallel = True,
auto_init = CI == True,
auto_init = CI,
labels = labels,
resource_deps = [
"next:web",
Expand Down
2 changes: 2 additions & 0 deletions apps/next/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ARG NEXT_PUBLIC_BUNDLER_RPC_URL
ARG NEXT_PUBLIC_MAINNET_CHAIN_ID
ARG NEXT_PUBLIC_BASE_CHAIN_ID
ARG NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
ARG NEXT_PUBLIC_TURNSTILE_SITE_KEY
ENV CI=${CI}
ENV DEBUG=${DEBUG}
ENV NEXT_PUBLIC_SUPABASE_PROJECT_ID=${NEXT_PUBLIC_SUPABASE_PROJECT_ID}
Expand All @@ -72,6 +73,7 @@ ENV NEXT_PUBLIC_BUNDLER_RPC_URL=${NEXT_PUBLIC_BUNDLER_RPC_URL}
ENV NEXT_PUBLIC_MAINNET_CHAIN_ID=${NEXT_PUBLIC_MAINNET_CHAIN_ID}
ENV NEXT_PUBLIC_BASE_CHAIN_ID=${NEXT_PUBLIC_BASE_CHAIN_ID}
ENV NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=${NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID}
ENV NEXT_PUBLIC_TURNSTILE_SITE_KEY=${NEXT_PUBLIC_TURNSTILE_SITE_KEY}
ENV TAMAGUI_TARGET=web
RUN --mount=type=cache,target=/tmp/yarn-cache \
--mount=type=cache,target=/tmp/turbo-cache \
Expand Down
11 changes: 6 additions & 5 deletions apps/next/utils/logRequest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { GetServerSidePropsContext } from 'next'

export function logRequest(ctx: GetServerSidePropsContext) {
console.log(
`${ctx.req.url} - ${ctx.req.headers['user-agent']}${
ctx.req.headers['x-forwarded-for'] ? ` - ${ctx.req.headers['x-forwarded-for']}` : ''
}`
)
const ip =
(ctx.req.headers['cf-connecting-ip'] ||
ctx.req.headers['x-forwarded-for'] ||
ctx.req.socket.remoteAddress) ??
''
console.log(`${ctx.req.url} - ${ctx.req.headers['user-agent']} - ${ip}`)
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- NEXT_PUBLIC_MAINNET_CHAIN_ID=${NEXT_PUBLIC_MAINNET_CHAIN_ID}
- NEXT_PUBLIC_BASE_CHAIN_ID=${NEXT_PUBLIC_BASE_CHAIN_ID}
- NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=${NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID}
- NEXT_PUBLIC_TURNSTILE_SITE_KEY=${NEXT_PUBLIC_TURNSTILE_SITE_KEY}
secrets:
- SUPABASE_DB_URL
- SUPABASE_SERVICE_ROLE
Expand Down
13 changes: 7 additions & 6 deletions packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import type { CreateNextContextOptions } from '@trpc/server/adapters/next'
import superJson from 'superjson'

export const createTRPCContext = async (opts: CreateNextContextOptions) => {
console.log(
`${opts.req.url} - ${opts.req.headers['user-agent']}${
opts.req.headers['x-forwarded-for'] ? ` - ${opts.req.headers['x-forwarded-for']}` : ''
}`
)
const ip =
(opts.req.headers['cf-connecting-ip'] ||
opts.req.headers['x-forwarded-for'] ||
opts.req.socket.remoteAddress) ??
''
console.log(`${opts.req.url} - ${opts.req.headers['user-agent']} - ${ip}`)

// if there's auth cookie it'll be authenticated by this helper
const supabase = createPagesServerClient<Database>(opts)

// native sends these instead of cookie auth
if (opts.req.headers.authorization && opts.req.headers['refresh-token']) {
// native sends these instead of cookie auth
const accessToken = opts.req.headers.authorization.split('Bearer ').pop()
const refreshToken = opts.req.headers['refresh-token']
if (accessToken && typeof refreshToken === 'string') {
Expand Down
4 changes: 2 additions & 2 deletions tilt/common.tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ contract_files = files_matching(

DEBUG = os.getenv("DEBUG", "").find("tilt") != -1

CI = os.getenv(
CI = bool(os.getenv(
"CI",
config.tilt_subcommand == "ci",
)
))

config.define_string_list(
"args",
Expand Down

0 comments on commit 6a914c0

Please sign in to comment.