All checks were successful
OSV-Scanner PR Scan / scan-pr (pull_request) Successful in 46s
70 lines
2.1 KiB
YAML
70 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://git.quad4.io/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
- name: Setup Node.js
|
|
uses: https://git.quad4.io/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install pnpm
|
|
uses: https://git.quad4.io/actions/setup-pnpm@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
|
|
with:
|
|
version: 10
|
|
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: https://git.quad4.io/actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Frontend checks
|
|
run: bash scripts/check.sh
|
|
- name: Build frontend
|
|
run: bash scripts/build.sh
|
|
- name: Upload frontend assets
|
|
uses: https://git.quad4.io/actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
with:
|
|
name: frontend-build
|
|
path: build/
|
|
|
|
build-backend:
|
|
runs-on: ubuntu-latest
|
|
needs: build-frontend
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://git.quad4.io/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
- name: Download frontend assets
|
|
uses: https://git.quad4.io/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
|
|
with:
|
|
name: frontend-build
|
|
path: build/
|
|
- name: Setup Go
|
|
uses: https://git.quad4.io/actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
|
|
with:
|
|
go-version: '1.25.4'
|
|
- name: Build backend
|
|
run: |
|
|
mkdir -p bin
|
|
CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/web-news main.go
|