Skip to content

Deploy staging

Deploy staging #333

name: Deploy staging
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
workflow_run:
workflows: ["Docker dev"]
branches: ["main"]
types:
- completed
jobs:
deploy_staging:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Deploy Blobscan API (staging)
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.blobscan.com
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: deploy
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: nohup ./deploy-blobscan.sh
- uses: actions/checkout@v4
with:
fetch-depth: 500
fetch-tags: true
- name: Setup
uses: ./tooling/github/setup
- name: Set environment variables
run: |
TAG=$(git describe --tags --always)
echo "NEXT_PUBLIC_BLOBSCAN_RELEASE=$TAG"
echo "NEXT_PUBLIC_BLOBSCAN_RELEASE=$TAG" >> $GITHUB_ENV
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}