Skip to content

chore(ci): specify VITE_API_URL when running pnpm build #33

chore(ci): specify VITE_API_URL when running pnpm build

chore(ci): specify VITE_API_URL when running pnpm build #33

Workflow file for this run

name: Build
on:
workflow_call:
push:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: 🔽 Checkout repository
uses: actions/checkout@v4
- name: ⚙️ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21
- name: ⚙️ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: 🔍 Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: ⚙️ Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: 📥 Restore dependencies
run: pnpm install
- name: ⚒ Build project
run: |
echo "VITE_API_URL=${{ vars.VITE_API_URL }}" >> .env
pnpm build
- name: ⬆️ Upload artifact
uses: actions/upload-artifact@v3
with:
name: build
path: 'dist/**'