Skip to content

Build and deploy to development #1106

Build and deploy to development

Build and deploy to development #1106

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build and deploy [dev / prod]
run-name: Build and deploy to ${{ github.ref == 'refs/heads/dev' && 'development' || 'production' }}
# Controls when the action will run.
on:
workflow_dispatch:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
- dev
env:
node_version: 20
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "install"
build-and-publish:
name: Build and publish
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: 'pnpm'
- run: pnpm install --prod
- uses: actions/checkout@v4
- name: Get env name
id: envRunner
run: echo "env=${{ github.ref == 'refs/heads/dev' && 'development' || 'production' }}" >> $GITHUB_OUTPUT
- name: Build and deploy
uses: ./.github/actions/build-and-deploy
with:
environment: ${{ steps.envRunner.outputs.env }}
node_version: ${{ env.node_version }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
- name: Set output variables
id: success
run: echo "buildStatus=success" >> $GITHUB_OUTPUT
github-release:
needs: [ build-and-publish ]
runs-on: ubuntu-latest
name: Generate Release Notes
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
branches: |
[
{
name: 'main'
},
{
name: 'dev',
prerelease: true
}
]
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUNNER_DEBUG: 1