Skip to content

Merge pull request #599 from gitautoai/wes #152

Merge pull request #599 from gitautoai/wes

Merge pull request #599 from gitautoai/wes #152

Workflow file for this run

name: Deploy to Vercel
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm i -g vercel@latest
- name: Deploy to Vercel
id: deploy
# https://vercel.com/guides/branch-variables-and-domains-not-linked-to-cli-deployments
run: |
deployment_url=$(vercel --yes --token=${{ secrets.VERCEL_TOKEN }} ${{ github.ref == 'refs/heads/main' && '--prod' || '' }} --meta githubDeployment="1" --meta githubCommitRef="${GITHUB_REF#refs/heads/}")
echo "deployment_url=$deployment_url" >> $GITHUB_OUTPUT
continue-on-error: true
- name: Notify Slack on Failure
if: failure()
uses: slackapi/[email protected]
with:
webhook-type: incoming-webhook
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
payload: |
{
"text": "<!channel> ❌ ${{ github.ref == 'refs/heads/main' && 'Production' || 'Preview' }} deployment failed${{ steps.deploy.outputs.deployment_url && format(' - {0}', steps.deploy.outputs.deployment_url) || '' }}"
}