feat(ci): add building workflow
This commit is contained in:
@@ -0,0 +1,59 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-backend:
|
||||||
|
name: Build Go Backend
|
||||||
|
runs-on: host-runner
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: apk add --no-cache go gcc musl-dev libpcap-dev
|
||||||
|
|
||||||
|
- name: Download modules
|
||||||
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -o bin/ids ./cmd/ids
|
||||||
|
|
||||||
|
- name: Upload binary
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ids-backend
|
||||||
|
path: bin/ids
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Clean up
|
||||||
|
run: rm -rf bin/
|
||||||
|
|
||||||
|
build-frontend:
|
||||||
|
name: Build Nuxt Frontend
|
||||||
|
runs-on: host-runner
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: frontend
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: apk add --no-cache nodejs npm && npm install
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run generate
|
||||||
|
|
||||||
|
- name: Upload dist
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ids-frontend
|
||||||
|
path: frontend/.output/public
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Clean up
|
||||||
|
run: rm -rf .output/
|
||||||
Reference in New Issue
Block a user