chore(ci/cd): adjust workflows ci/cd files to work with actions/cache

This commit is contained in:
Ilia Mashkov
2025-12-30 19:37:25 +03:00
parent 7c94622b95
commit 53e3d6985b
4 changed files with 53 additions and 172 deletions

View File

@@ -1,59 +1,32 @@
name: Build
on:
push:
branches:
- main
- develop
branches: [main, develop]
pull_request:
branches:
- main
- develop
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
- uses: actions/checkout@v4
- name: Setup Node.js
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install
run: yarn install --frozen-lockfile --prefer-offline
- name: Run SvelteKit sync
run: yarn svelte-kit sync
- name: Build project
- name: Build Svelte App
run: yarn build
env:
NODE_ENV: production
- name: Upload build artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
.svelte-kit/output
.svelte-kit/build
path: dist/
retention-days: 7
- name: Verify build (Preview)
run: |
yarn preview &
PREVIEW_PID=$!
sleep 5
curl -f http://localhost:4173 || exit 1
kill $PREVIEW_PID