UnlyEd/next-typescript-api-zeit-boilerplate

View on GitHub
.github/workflows/deploy-zeit-staging.yml

Summary

Maintainability
Test Coverage
# XXX See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
# Deploy to Vercel when anything is pushed in any branch other than the "master" branch.
# You must have added a GitHub secret "VERCEL_TOKEN" in your GitHub project for the deploy to succeed
name: Deploy to Now staging

on:
  push:
    branches-ignore:
      - 'master'

jobs:
  setup:
    name: Setup deployment environment
    runs-on: ubuntu-latest
    steps:
      - name: Installing node.js
        uses: actions/setup-node@v1 # Used to install node environment
        with:
          node-version: '10.x' # Use the same node.js version as the one Vercel's uses (currently node14.x)

  deploy-staging:
    name: Deploy on staging
    runs-on: ubuntu-latest
    needs: setup # Need to wait for setup
    steps:
      - uses: actions/checkout@v1 # Get last commit pushed
      - name: Deploying on Vercel
        run: yarn deploy --token $VERCEL_TOKEN
        env:
          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Passing github's secret to the worker