Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/actions/vercel/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ runs:
export GITHUB_SHA=${{ inputs.sha }}
export GITHUB_REF_NAME=${{ inputs.ref-name }}
pnpx vercel build
if [ "${{ inputs.environment }}" = "production" ]; then
pnpx vercel build --prod
else
pnpx vercel build
fi
shell: bash

- name: Patch
Expand All @@ -103,17 +107,27 @@ runs:
- name: Deploy
id: deploy
run: |
pnpx vercel deploy \
--prebuilt \
--token ${{ inputs.vercel-token }} \
2> >(tee info.txt >&2) | tee domain.txt
if [ "${{ inputs.environment }}" = "production" ]; then
pnpx vercel deploy \
--prebuilt \
--prod \
--skip-domain \
--token ${{ inputs.vercel-token }} \
2> >(tee info.txt >&2) | tee domain.txt
else
pnpx vercel deploy \
--prebuilt \
--token ${{ inputs.vercel-token }} \
2> >(tee info.txt >&2) | tee domain.txt
fi
echo "domain=$(cat ./domain.txt)" >> $GITHUB_OUTPUT
echo "inspect-url=$(cat info.txt | grep 'Inspect:' | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Set Alias
if: ${{ inputs.environment != 'production' }}
id: alias
run: |
ALIAS="${{ steps.branch.outputs.value }}"
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/vercel-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ jobs:
sha: ${{ github.sha }}
environment: ${{ matrix.environment }}

- uses: ./.github/actions/vercel
if: matrix.environment == 'staging'
id: vercel-prod
name: Deploy to Vercel
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
ref-name: ${{ github.ref_name }}
sha: ${{ github.sha }}
environment: "production"

- name: Debug Vercel Outputs
run: |
echo "domain=${{ steps.vercel.outputs.domain }}"
Expand All @@ -74,6 +86,13 @@ jobs:
description: "[${{ matrix.environment }}] Vercel logs"
url: "${{ steps.vercel.outputs.inspect-url }}"

- uses: ./.github/actions/add-status
if: matrix.environment == 'staging'
with:
title: "⏰ [${{ matrix.environment }}] Vercel Production Inspection"
description: "[${{ matrix.environment }}] Vercel production logs"
url: "${{ steps.vercel-prod.outputs.inspect-url }}"

- uses: ./.github/actions/add-status
with:
title: "⭐ [${{ matrix.environment }}] Apps Webstudio URL"
Expand Down