Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/contract-bindings-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Contract Bindings Check

on:
push:
branches: [main, next]
branches: [main]
pull_request:

permissions:
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Deploy lit-api-server + lit-actions + otel-collector to Phala CVM
#
# Deployment targets:
# push to next → chipotle-next (direct automated deploy)
# push to main → chipotle-dev (direct automated deploy)
# push to main → chipotle-next (direct automated deploy)
#
# For production (v* tag) deploys, see deploy-prod-1-propose.yml and deploy-prod-2-execute.yml.
#
Expand Down Expand Up @@ -56,7 +55,7 @@ concurrency:

on:
push:
branches: [main, next]
branches: [main]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -101,16 +100,10 @@ jobs:
id: set
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "phala_app_name=chipotle-dev" >> "$GITHUB_OUTPUT"
echo "instance_type=tdx.large" >> "$GITHUB_OUTPUT"
echo "gcp_project_id=chipotle-dev" >> "$GITHUB_OUTPUT"
echo "node_config=NodeConfig.main.toml" >> "$GITHUB_OUTPUT"
DOMAIN="api.dev.litprotocol.com"
elif [ "${{ github.ref }}" = "refs/heads/next" ]; then
echo "phala_app_name=chipotle-next" >> "$GITHUB_OUTPUT"
echo "instance_type=tdx.small" >> "$GITHUB_OUTPUT"
echo "gcp_project_id=chipotle-next" >> "$GITHUB_OUTPUT"
echo "node_config=NodeConfig.next.toml" >> "$GITHUB_OUTPUT"
echo "node_config=NodeConfig.main.toml" >> "$GITHUB_OUTPUT"
DOMAIN="test.chipotle.litprotocol.com"
else
echo "Unsupported branch for deployment"
Expand Down Expand Up @@ -292,8 +285,8 @@ jobs:
env:
PHALA_CLOUD_API_KEY: ${{ secrets.PHALA_CLOUD_API_KEY }}
PHALA_PRIVATE_KEY: ${{ secrets.PHALA_DSTACKAPP_PRIVATE_KEY }}
STRIPE_SECRET_KEY: ${{ github.ref != 'refs/heads/main' && secrets.STRIPE_SANDBOX_SECRET_KEY || '' }}
STRIPE_PUBLISHABLE_KEY: ${{ github.ref != 'refs/heads/main' && secrets.STRIPE_SANDBOX_PUBLISHABLE_KEY || '' }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SANDBOX_SECRET_KEY }}
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_SANDBOX_PUBLISHABLE_KEY }}
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
BASE_CHAIN_RPC: ${{ secrets.BASE_CHAIN_RPC }}
CERTBOT_AWS_ACCESS_KEY_ID: ${{ secrets.CERTBOT_AWS_ACCESS_KEY_ID }}
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/deploy-static.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Static Site
on:
push:
branches: [main, next]
branches: [main]
paths:
- 'lit-static/**'
- '.github/workflows/deploy-static.yml'
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy-preview is gated on github.event_name == 'pull_request', but this workflow is only triggered by push events. As a result, PR preview deployments will never run. Add a pull_request trigger (and optionally restrict paths) or remove the preview job/condition if previews are no longer intended.

Suggested change
- '.github/workflows/deploy-static.yml'
- '.github/workflows/deploy-static.yml'
pull_request:
paths:
- 'lit-static/**'
- '.github/workflows/deploy-static.yml'

Copilot uses AI. Check for mistakes.
Expand All @@ -17,26 +17,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"

- name: Inject API URL
run: sed -i "s|__LIT_API_BASE_URL__|https://api.dev.litprotocol.com|g" lit-static/dapps/dashboard/auth.js

- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy lit-static --project-name=lit-static-dev --branch=main

deploy-next:
if: github.ref == 'refs/heads/next'
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"
Expand Down Expand Up @@ -71,4 +51,4 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy lit-static --project-name=lit-static-dev --branch=${{ github.head_ref }}
command: pages deploy lit-static --project-name=lit-static-next --branch=${{ github.head_ref }}
2 changes: 1 addition & 1 deletion .github/workflows/k6-client-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: k6 Client Check

on:
push:
branches: [main, next]
branches: [main]
pull_request:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k6-correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
correctness:
runs-on: self-hosted
env:
K6_ACCOUNTS_FILE: ${{ inputs.accounts_file || (github.ref_name == 'next' && './data/accounts.next.json' || './data/accounts.dev.json') }}
K6_ACCOUNTS_FILE: ${{ inputs.accounts_file || (github.ref_name == 'main' && './data/accounts.next.json' || './data/accounts.dev.json') }}
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k6-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
k6-smoke:
runs-on: self-hosted
env:
K6_ACCOUNTS_FILE: ${{ inputs.accounts_file || (github.ref_name == 'next' && './data/accounts.next.json' || './data/accounts.dev.json') }}
K6_ACCOUNTS_FILE: ${{ inputs.accounts_file || (github.ref_name == 'main' && './data/accounts.next.json' || './data/accounts.dev.json') }}
steps:
- uses: actions/checkout@v4

Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/phala-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: Phala Simulator Validation

on:
push:
branches: [main, next]
branches: [main]
pull_request:

permissions:
Expand Down Expand Up @@ -195,12 +195,8 @@ jobs:
exit 1
}

# Copy branch-appropriate config (NodeConfig.toml is gitignored); main uses main.toml, others use next.toml.
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
cp lit-api-server/NodeConfig.main.toml lit-api-server/NodeConfig.toml
else
cp lit-api-server/NodeConfig.next.toml lit-api-server/NodeConfig.toml
fi
# NodeConfig.toml is gitignored; copy the main config in.
cp lit-api-server/NodeConfig.main.toml lit-api-server/NodeConfig.toml
# Pick a random free TCP port per run so concurrent jobs on the
# same self-hosted host don't collide on the default Rocket port
# (8000). ROCKET_PORT overrides lit-api-server/Rocket.toml.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ COPY --from=builder /app/lit-actions/target/debug/lit_actions /usr/local/bin/
# Copy static assets (served by lit-api-server)
COPY --from=builder /app/lit-api-server/static /app/lit-api-server/static/

# Copy configuration file (main branch uses NodeConfig.main.toml; default: next)
ARG NODE_CONFIG=NodeConfig.next.toml
# Copy configuration file.
ARG NODE_CONFIG=NodeConfig.main.toml
COPY lit-api-server/${NODE_CONFIG} /app/NodeConfig.toml

# Copy and set entrypoint script (starts lit_actions in background, then lit-api-server)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.lit-api-server
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ COPY --from=builder /build/lit-api-server/target/release/lit-api-server /usr/loc
COPY --from=builder /build/lit-api-server/Rocket.toml /app/
COPY --from=builder /build/lit-api-server/rpc-config.yaml /app/
COPY --from=builder /build/lit-api-server/log_levels.toml /app/
# NodeConfig.toml required at startup (main branch uses NodeConfig.main.toml; default: next)
ARG NODE_CONFIG=NodeConfig.next.toml
# NodeConfig.toml required at startup.
ARG NODE_CONFIG=NodeConfig.main.toml
COPY --from=builder /build/lit-api-server/${NODE_CONFIG} /app/NodeConfig.toml

CMD ["lit-api-server"]
12 changes: 6 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ image_tag := env('DOCKER_TAG', `uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '\n
image_lit_actions := image_base + '-lit-actions:' + image_tag
image_lit_api_server := image_base + '-lit-api-server:' + image_tag
image_otel_collector := image_base + '-otel-collector:' + image_tag
# main → chipotle-dev; any other branch → chipotle-next (override with PHALA_APP_NAME)
app_name := `git branch --show-current | xargs -I {} sh -c '[ "{}" = "main" ] && echo chipotle-dev || echo chipotle-next'`
instance_type := `git branch --show-current | xargs -I {} sh -c '[ "{}" = "main" ] && echo tdx.small || echo tdx.small'`
gcp_project_id := `git branch --show-current | xargs -I {} sh -c '[ "{}" = "main" ] && echo chipotle-dev || echo chipotle-next'`
node_config := `git branch --show-current | xargs -I {} sh -c '[ "{}" = "main" ] && echo NodeConfig.main.toml || echo NodeConfig.next.toml'`
domain := `git branch --show-current | xargs -I {} sh -c '[ "{}" = "main" ] && echo api.dev.litprotocol.com || echo test.chipotle.litprotocol.com'`
# main → chipotle-next (override with PHALA_APP_NAME)
app_name := 'chipotle-next'
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "override with PHALA_APP_NAME", but app_name is currently hard-coded and does not read PHALA_APP_NAME from the environment. Either wire app_name to env('PHALA_APP_NAME', ...) (or document the actual override mechanism, e.g. passing app_name=.../deploy name=... to just).

Suggested change
app_name := 'chipotle-next'
app_name := env('PHALA_APP_NAME', 'chipotle-next')

Copilot uses AI. Check for mistakes.
instance_type := 'tdx.small'
gcp_project_id := 'chipotle-next'
node_config := 'NodeConfig.main.toml'
domain := 'test.chipotle.litprotocol.com'

import "justfile.deploy"
import "justfile.sim"
Expand Down
9 changes: 2 additions & 7 deletions justfile.sim
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,8 @@ sim-verify: sim-build verifier-build api-server
exit 1
}

# Copy branch-appropriate config (NodeConfig.toml is gitignored); main uses main.toml, others use next.toml.
BRANCH=$(git -C "$PROJECT_ROOT" branch --show-current)
if [ "$BRANCH" = "main" ]; then
cp "$PROJECT_ROOT/lit-api-server/NodeConfig.main.toml" "$PROJECT_ROOT/lit-api-server/NodeConfig.toml"
else
cp "$PROJECT_ROOT/lit-api-server/NodeConfig.next.toml" "$PROJECT_ROOT/lit-api-server/NodeConfig.toml"
fi
# NodeConfig.toml is gitignored; copy the main config in.
cp "$PROJECT_ROOT/lit-api-server/NodeConfig.main.toml" "$PROJECT_ROOT/lit-api-server/NodeConfig.toml"
API_BIN="$PROJECT_ROOT/lit-api-server/target/debug/lit-api-server"
echo "Starting lit-api-server (demo config)..."
(cd "$PROJECT_ROOT/lit-api-server" && DSTACK_SOCKET="$SIM_SOCK" "$API_BIN") >> "$SIM_TMP/lit-api-server.log" 2>&1 &
Expand Down
4 changes: 3 additions & 1 deletion lit-api-server/NodeConfig.main.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[chain]
name = "base"
contract_address = "0x4c8eb9f329ebfdb369f0c90954875ef8f568ad24"
contract_address = "0x98e501fab2d60a5119a185e1563f10cb54bc6068"

# contract_address = "0x6c4989c3c2aab271444b4b7b4ec3aca6da1bf1e5" # old contracts, TODO: about 10 USD still sitting in api-payer signers
Comment on lines +3 to +5
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With NodeConfig.next.toml removed/retired, there are still repo references to it (e.g. manual_contract-upgrade.yml offers a next option that maps to lit-api-server/NodeConfig.next.toml). This will cause that workflow to fail when next is selected unless the workflow is updated or an alias config file is kept.

Copilot uses AI. Check for mistakes.
5 changes: 0 additions & 5 deletions lit-api-server/NodeConfig.next.toml

This file was deleted.

Loading