Image sizes (#208) #71
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: Deploy Widget | |
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: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
production: | |
name: Deploy to Production | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: (contains(github.ref, 'tags') && ! contains(github.ref, 'prerelease')) || github.ref == 'refs/heads/master' | |
environment: | |
name: production | |
url: https://widget.perscom.io | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v3 | |
- name: Get Version | |
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- 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: Setup Vercel | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE}} | |
- name: Setup Environment Variables | |
run: | | |
vercel env pull .env.local --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
echo SENTRY_RELEASE=${{ env.VERSION }} >> .env.local | |
echo NEXT_PUBLIC_WIDGET_VERSION=${{ env.VERSION }} >> .env.local | |
- name: Build Widget | |
run: npm run build:widget | |
env: | |
WIDGET_URL: https://widget.perscom.io | |
- name: Build Project Artifacts | |
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Create Sentry Release | |
uses: getsentry/action-release@v1 | |
with: | |
environment: production | |
version: ${{ env.VERSION }} | |
sourcemaps: ./dist ./build/static/js | |
staging: | |
name: Deploy to Staging | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: contains(github.ref, 'prerelease') || github.ref == 'refs/heads/staging' | |
environment: | |
name: staging | |
url: https://widget.staging.perscom.io | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v3 | |
- name: Get Version | |
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- 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: 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 SENTRY_RELEASE=${{ env.VERSION }} >> .env.local | |
echo NEXT_PUBLIC_WIDGET_VERSION=${{ env.VERSION }} >> .env.local | |
- name: Build Widget | |
run: npm run build:widget | |
env: | |
WIDGET_URL: https://widget.staging.perscom.io | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Create Sentry Release | |
uses: getsentry/action-release@v1 | |
with: | |
environment: staging | |
version: ${{ env.VERSION }} | |
sourcemaps: ./dist ./build/static/js |