Skip to content

Commit

Permalink
Created deployment workflow for staging environment and added new script
Browse files Browse the repository at this point in the history
The new stage deployment workflow, 'deploy-staging.yaml', has been added to automate deployment whenever changes are made to the 'DEV' branch. This workflow also introduces environment variables, necessary permissions, and job definitions. A new script, 'sst:deploy:dev', has been incorporated into 'package.json' for deploying to the developer stage.
  • Loading branch information
jakubswierczek committed Apr 5, 2024
1 parent 2bbad1c commit a1a61fb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Deploy Staging'
concurrency: staging
on:
push:
branches:
- DEV
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy:
name: Build & Deploy staging using SST
environment: staging
runs-on: ubuntu-latest
env:
ONE_INCH_API_KEY: ${{ secrets.ONE_INCH_API_KEY }}
ONE_INCH_API_VERSION: ${{ secrets.ONE_INCH_API_VERSION }}
ONE_INCH_API_URL: ${{ secrets.ONE_INCH_API_URL }}
ONE_INCH_ALLOWED_SWAP_PROTOCOLS: ${{ secrets.ONE_INCH_ALLOWED_SWAP_PROTOCOLS }}
ONE_INCH_SWAP_CHAIN_IDS: ${{ secrets.ONE_INCH_SWAP_CHAIN_IDS }}
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
SUBGRAPH_BASE: ${{ secrets.SUBGRAPH_BASE }}
RPC_GATEWAY: ${{ secrets.RPC_GATEWAY }}
DEBANK_API_KEY: ${{ secrets.DEBANK_API_KEY }}
DEBANK_API_URL: ${{ secrets.DEBANK_API_URL }}
POWERTOOLS_LOG_LEVEL: ${{ vars.POWERTOOLS_LOG_LEVEL }}

steps:
- name: Git clone the repository
uses: actions/checkout@v3

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: pnpm/action-setup@v2.0.1
with:
version: 8.14.1

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
# role-duration-seconds: 14390 #adjust as needed for your build time
aws-region: ${{ secrets.AWS_REGION }}

- name: Install dependencies
run: pnpm install

- name: Deploy app
run: |
pnpm run sst:deploy:staging
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"cicheck": "turbo run cicheck --cache-dir=.turbo",
"sst:dev": "sst dev",
"sst:build": "sst build",
"sst:deploy:dev": "sst deploy --stage dev",
"sst:deploy:staging": "sst deploy --stage staging",
"sst:deploy:prod": "sst deploy --stage production",
"remove": "sst remove --stage dev",
Expand Down

0 comments on commit a1a61fb

Please sign in to comment.