Fix calendar #161
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Preview | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
on: | |
pull_request: | |
jobs: | |
preview: | |
name: Deploy to Vercel | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Get Next Version | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
default_bump: patch | |
default_prerelease_bump: prerelease | |
release_branches: master | |
pre_release_branches: staging | |
append_to_pre_release_tag: prerelease | |
dry_run: true | |
- name: Setup Vercel | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE}} | |
- name: Setup Environment Variables | |
run: | | |
vercel env pull .env.local --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
echo API_KEY=${{ secrets.VERCEL_PREVIEW_API_KEY }} >> .env.local | |
echo PERSCOM_ID=${{ secrets.VERCEL_PREVIEW_PERSCOM_ID }} >> .env.local | |
echo SENTRY_RELEASE=${{ steps.tag_version.outputs.new_tag }}-preview.$(git rev-parse --short "$GITHUB_SHA") >> .env.local | |
echo NEXT_PUBLIC_WIDGET_VERSION=${{ steps.tag_version.outputs.new_tag }}-preview.$(git rev-parse --short "$GITHUB_SHA") >> .env.local | |
- name: Build Widget | |
run: npm run build:widget | |
env: | |
WIDGET_URL: https://staging.widget.perscom.io | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: echo "DEPLOYMENT_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_ENV | |
- name: Add PR Comment | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message: | | |
**Vercel Deployment** | |
✅ Deployment Preview URL: [${{ env.DEPLOYMENT_URL }}](${{ env.DEPLOYMENT_URL }}) |