58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: Deploy Pipeline
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: 'Target'
|
|
required: true
|
|
default: 'production'
|
|
type: choice
|
|
options: [staging, production]
|
|
|
|
jobs:
|
|
pipeline:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '25'
|
|
# We handle caching manually below to ensure
|
|
# corepack-managed yarn is used correctly.
|
|
|
|
- name: Enable Corepack
|
|
run: |
|
|
corepack enable
|
|
corepack prepare yarn@stable --activate
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Persistent Yarn Cache
|
|
uses: actions/cache@v4
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile --prefer-offline
|
|
|
|
- name: Validation
|
|
run: |
|
|
yarn oxlint .
|
|
yarn svelte-check
|
|
|
|
- name: Build for Production
|
|
run: yarn build
|
|
env:
|
|
NODE_ENV: production
|