Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/rust
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/example.yml
  • Loading branch information
jantimon committed Jul 18, 2024
2 parents a003f8b + ebefecc commit 563b2d1
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,40 @@ name: Build and Deploy packages/example
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

on:
push:
branches-ignore:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Add wasm32-wasi target
run: rustup target add wasm32-wasi

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.6.1
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- name: Install node_modules
run: pnpm install

- name: Install Vercel CLI
run: npm install -g vercel@35

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Add wasm32-wasi target
run: rustup target add wasm32-wasi
- name: Enable caching
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -51,14 +44,29 @@ jobs:
- name: Build with SWC
run: pnpm run build:swc

- name: Install Vercel CLI
run: npm install -g vercel@35
- name: Link Vercel project
run: vercel link --yes --token ${{ secrets.VERCEL_TOKEN }}

- name: Pull Vercel environment information

# Preview deployment (for pull requests and non-main pushes)
- name: Pull Vercel environment information (Preview)
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
run: vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN }}
- name: Build project artifacts (Preview)
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
run: vercel build --token ${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
run: vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}

- name: Build project artifacts
run: vercel build --yes --token ${{ secrets.VERCEL_TOKEN }}

- name: Deploy to Vercel
run: vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}
# Production deployment (for main branch pushes)
- name: Pull Vercel environment information (Production)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: vercel pull --yes --environment=production --token ${{ secrets.VERCEL_TOKEN }}
- name: Build project artifacts (Production)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: vercel build --prod --token ${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Production)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: vercel deploy --prebuilt --prod --token ${{ secrets.VERCEL_TOKEN }}

0 comments on commit 563b2d1

Please sign in to comment.