60 lines
1.2 KiB
YAML
60 lines
1.2 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- develop
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Project
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'yarn'
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run SvelteKit sync
|
|
run: yarn svelte-kit sync
|
|
|
|
- name: Build project
|
|
run: yarn build
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-artifacts
|
|
path: |
|
|
.svelte-kit/output
|
|
.svelte-kit/build
|
|
retention-days: 7
|
|
|
|
- name: Verify build (Preview)
|
|
run: |
|
|
yarn preview &
|
|
PREVIEW_PID=$!
|
|
sleep 5
|
|
curl -f http://localhost:4173 || exit 1
|
|
kill $PREVIEW_PID
|