chore: add preview release (#104) #4
This file contains hidden or 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 release | |
permissions: | |
pull-requests: write | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, labeled] | |
jobs: | |
preview: | |
if: > | |
github.repository == 'supabase/functions-js' && | |
(github.event_name == 'push' || | |
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview'))) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- run: npx pkg-pr-new@latest publish --compact |