Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Merge pull request #259 from igrowker/devops/vercel-metrics #76

Merge pull request #259 from igrowker/devops/vercel-metrics

Merge pull request #259 from igrowker/devops/vercel-metrics #76

Workflow file for this run

name: Deploy to Vercel
on:
push:
branches:
- main
- develop
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm install --no-audit --no-fund
- name: Deploy to Vercel (Preview)
id: deploy
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_ORG_ID }}
vercel-args: ${{ github.ref == 'refs/heads/main' && '--prod' || '' }}
working-directory: ./
github-comment: true
- name: Print preview URL
run: |
echo ${{ steps.deploy.outputs.preview-url }}
- name: Create issue if deploy fails
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
ACTION_TYPE: 'Deploy'
URL_ACTION_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
BRANCH: ${{ github.ref }}
with:
assignees: ${{ github.event.sender.login }}