Merge pull request 'feat: remove DATABASE_URL from Vercel deployment workflow environment variables' (#11) from feature/adds-deploy-workflow into main
Reviewed-on: http://gitea.hideyoshi.com.br/HideyoshiNakazone/hideyoshi-blog/pulls/11
This commit was merged in pull request #11.
This commit is contained in:
42
.github/workflows/deploy-preview.yml
vendored
Normal file
42
.github/workflows/deploy-preview.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Vercel Preview Deployment
|
||||
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Vercel CLI
|
||||
run: npm install --global vercel@latest
|
||||
|
||||
- name: Pull Vercel Environment Information
|
||||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
|
||||
|
||||
- name: Build Project Artifacts
|
||||
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
|
||||
|
||||
- name: Deploy Project Artifacts to Vercel
|
||||
id: deploy
|
||||
run: echo "url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment Preview URL on PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `🔍 **Preview deployment ready!**\n\n${{ steps.deploy.outputs.url }}`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user