60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy-web:
|
|
name: Deploy Frontend (Vercel)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Deploy to Vercel
|
|
uses: amondnet/vercel-action@v25
|
|
with:
|
|
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
vercel-args: '--prod'
|
|
|
|
deploy-indexer:
|
|
name: Deploy Indexer (Railway)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Railway CLI
|
|
run: npm i -g @railway/cli
|
|
|
|
- name: Deploy to Railway
|
|
run: railway up --service indexer
|
|
env:
|
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|
|
|
|
deploy-contracts:
|
|
name: Deploy Smart Contracts
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy-contracts]')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Setup Anchor
|
|
run: |
|
|
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
|
|
avm install latest
|
|
avm use latest
|
|
|
|
- name: Build contracts
|
|
run: cd packages/anchor/programs/betfun && anchor build
|
|
|
|
- name: Deploy to mainnet
|
|
run: cd packages/anchor/programs/betfun && anchor deploy --provider.cluster mainnet
|
|
env:
|
|
ANCHOR_WALLET: ${{ secrets.ANCHOR_WALLET }}
|
|
|