mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-11 16:52:16 +03:00
5caf1f9f6f
Takes the v2 tree, with packages/console, packages/web, packages/stats, packages/function, infra and sst.config.ts merged up to latest dev, and retargets V2 publishing and deploys from the v2 branch to dev.
52 lines
1.9 KiB
YAML
52 lines
1.9 KiB
YAML
name: deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- production
|
|
- beta
|
|
workflow_dispatch:
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
deploy:
|
|
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production' || github.ref_name == 'beta')
|
|
runs-on: ${{ github.ref_name == 'dev' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
|
environment: ${{ github.ref_name }}
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
|
|
|
- uses: ./.github/actions/setup-bun
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: "24"
|
|
|
|
- uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
|
|
if: github.ref_name != 'beta'
|
|
with:
|
|
role-to-assume: ${{ vars.AWS_DEPLOY_ROLE_ARN }}
|
|
role-session-name: opencode-${{ github.run_id }}
|
|
aws-region: us-east-1
|
|
|
|
- run: bun sst deploy --stage=${{ github.ref_name }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
PLANETSCALE_SERVICE_TOKEN_NAME: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }}
|
|
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
|
|
STRIPE_SECRET_KEY: ${{ github.ref_name == 'production' && secrets.STRIPE_SECRET_KEY_PROD || secrets.STRIPE_SECRET_KEY_DEV }}
|
|
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY }}
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
|
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}
|
|
SENTRY_RELEASE: web@${{ github.sha }}
|
|
VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }}
|
|
VITE_SENTRY_RELEASE: web@${{ github.sha }}
|