Skip to content

👷 Setup PR deployments #2

👷 Setup PR deployments

👷 Setup PR deployments #2

name: Build & Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
jobs:
build-and-deploy-pr-previews:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
if: github.event.action != 'closed'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NUXT_APP_BASE_URL: '/telehoraire-website/pr-preview/pr-${{ github.event.number }}'
SOURCE_API_URL: ${{ vars.SOURCE_API_URL }}
TZ: ${{ vars.TZ }}
- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: '.output/public/'