update workflows.

This commit is contained in:
Miroslav Šedivý
2025-03-22 20:39:41 +01:00
parent 718294bbbf
commit 7f2dd28f99
6 changed files with 61 additions and 22 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Build and Publish Client Artifacts
on:
pull_request: # Change to push when ready to deploy
branches:
- master
paths:
- client/**
- .github/workflows/client_build.yml
jobs:
client_build:
name: Build and Publish Client Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
working-directory: ./client
run: npm ci
- name: Build client
working-directory: ./client
run: npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: client
path: client/dist
+3
View File
@@ -6,6 +6,7 @@ on:
- master
paths:
- client/**
- .github/workflows/client_test.yml
jobs:
client_test:
@@ -16,6 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
@@ -25,6 +27,7 @@ jobs:
- name: Install dependencies
working-directory: ./client
run: npm ci
- name: Build client
working-directory: ./client
run: npm run build
+13 -20
View File
@@ -1,11 +1,12 @@
name: Build and Publish Server Artifacts
on:
pull_request:
pull_request: # Change to push when ready to deploy
branches:
- master
paths:
- server/**
- .github/workflows/server_build.yml
jobs:
server_build:
@@ -13,23 +14,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- name: amd64
platform: linux/amd64
- name: arm64
platform: linux/arm64
- name: armv7
platform: linux/arm/v7
variant:
- name: bullseye
- name: server-amd64
platform: linux/amd64
dockerfile: Dockerfile
- name: bookworm
- name: server-arm64
platform: linux/arm64
dockerfile: Dockerfile.bookworm
fail-fast: false
env:
ARTIFACT_NAME: ${{ matrix.arch.name }}-${{ matrix.variant.name }}-server
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -53,19 +46,19 @@ jobs:
with:
context: ./server/
file: ./server/${{ matrix.variant.dockerfile }}
tags: ${{ env.ARTIFACT_NAME }}
platforms: ${{ matrix.arch.platform }}
tags: ${{ matrix.variant.name }}
platforms: ${{ matrix.variant.platform }}
load: true
- name: Copy artifacts
run: |
container_id=$(docker create ${{ env.ARTIFACT_NAME }})
mkdir -p artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }}
docker cp $container_id:/src/bin/. artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }}/
container_id=$(docker create ${{ matrix.variant.name }})
mkdir -p artifacts/${{ matrix.variant.name }}
docker cp $container_id:/src/bin/. artifacts/${{ matrix.variant.name }}/
docker rm $container_id
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }}
name: ${{ matrix.variant.name }}
path: artifacts/${{ matrix.variant.name }}
+1
View File
@@ -6,6 +6,7 @@ on:
- master
paths:
- server/**
- .github/workflows/server_test.yml
jobs:
server_test:
+4 -2
View File
@@ -1,4 +1,4 @@
name: Deploy to GitHub Pages
name: Build and Deploy Webpage to GitHub Pages
on:
push:
@@ -6,10 +6,11 @@ on:
- master
paths:
- webpage/**
- .github/workflows/webpage_deploy.yml
jobs:
webpage_build:
name: Build Docusaurus
name: Build and Deploy Webpage to GitHub Pages
runs-on: ubuntu-latest
steps:
@@ -25,6 +26,7 @@ jobs:
- name: Install dependencies
working-directory: ./webpage
run: npm ci
- name: Build webpage
working-directory: ./webpage
run: npm run build
+1
View File
@@ -6,6 +6,7 @@ on:
- master
paths:
- webpage/**
- .github/workflows/webpage_test.yml
jobs:
webpage_test: