mirror of
https://github.com/JonasunderscoreJones/codes.jonasjones.dev.git
synced 2025-10-22 18:39:20 +02:00
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: build-sveltekit
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: checkout repository
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
- name: setup node
|
|
uses: https://github.com/actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: restore cached dependencies
|
|
uses: https://code.forgejo.org/actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
node_modules
|
|
key: ${{ runner.os }}-SvelteKit-${{ hashFiles('package-lock.json') }}
|
|
|
|
- name: install dependencies
|
|
run: npm install --frozen-lockfile
|
|
|
|
- name: build project
|
|
run: npm run build
|
|
|
|
- name: capture build artifacts
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
with:
|
|
name: sveltekit-artifacts
|
|
path: .svelte-kit/output/
|
|
if-no-files-found: error
|
|
|
|
- name: cache downloaded dependencies
|
|
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
|
uses: https://code.forgejo.org/actions/cache/save@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
node_modules
|
|
key: ${{ runner.os }}-SvelteKit-${{ hashFiles('package-lock.json') }}
|