mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
65 lines
No EOL
2 KiB
YAML
65 lines
No EOL
2 KiB
YAML
name: Deploy to Vercel Production
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
environment: production
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
|
|
- name: Pull Vercel Environment Information
|
|
run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
|
|
- name: Build Project Artifacts
|
|
run: vercel build --prod --token=$VERCEL_TOKEN
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
|
|
- name: Deploy to Vercel Production
|
|
run: |
|
|
DEPLOYMENT_URL=$(vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN)
|
|
echo "Deployed to: $DEPLOYMENT_URL"
|
|
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
|
|
id: deploy
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
|
|
- name: Comment on Release
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const deployment_url = '${{ steps.deploy.outputs.deployment_url }}';
|
|
const { owner, repo } = context.repo;
|
|
const release_id = context.payload.release.id;
|
|
|
|
await github.rest.repos.updateRelease({
|
|
owner,
|
|
repo,
|
|
release_id,
|
|
body: context.payload.release.body +
|
|
'\n\n---\n🚀 **Deployed to Production:** ' + deployment_url
|
|
}); |