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 - master
paths: paths:
- client/** - client/**
- .github/workflows/client_test.yml
jobs: jobs:
client_test: client_test:
@@ -16,6 +17,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
@@ -25,6 +27,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
working-directory: ./client working-directory: ./client
run: npm ci run: npm ci
- name: Build client - name: Build client
working-directory: ./client working-directory: ./client
run: npm run build run: npm run build
+13 -20
View File
@@ -1,11 +1,12 @@
name: Build and Publish Server Artifacts name: Build and Publish Server Artifacts
on: on:
pull_request: pull_request: # Change to push when ready to deploy
branches: branches:
- master - master
paths: paths:
- server/** - server/**
- .github/workflows/server_build.yml
jobs: jobs:
server_build: server_build:
@@ -13,23 +14,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
arch:
- name: amd64
platform: linux/amd64
- name: arm64
platform: linux/arm64
- name: armv7
platform: linux/arm/v7
variant: variant:
- name: bullseye - name: server-amd64
platform: linux/amd64
dockerfile: Dockerfile dockerfile: Dockerfile
- name: bookworm - name: server-arm64
platform: linux/arm64
dockerfile: Dockerfile.bookworm dockerfile: Dockerfile.bookworm
fail-fast: false fail-fast: false
env:
ARTIFACT_NAME: ${{ matrix.arch.name }}-${{ matrix.variant.name }}-server
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -53,19 +46,19 @@ jobs:
with: with:
context: ./server/ context: ./server/
file: ./server/${{ matrix.variant.dockerfile }} file: ./server/${{ matrix.variant.dockerfile }}
tags: ${{ env.ARTIFACT_NAME }} tags: ${{ matrix.variant.name }}
platforms: ${{ matrix.arch.platform }} platforms: ${{ matrix.variant.platform }}
load: true load: true
- name: Copy artifacts - name: Copy artifacts
run: | run: |
container_id=$(docker create ${{ env.ARTIFACT_NAME }}) container_id=$(docker create ${{ matrix.variant.name }})
mkdir -p artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }} mkdir -p artifacts/${{ matrix.variant.name }}
docker cp $container_id:/src/bin/. artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }}/ docker cp $container_id:/src/bin/. artifacts/${{ matrix.variant.name }}/
docker rm $container_id docker rm $container_id
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.ARTIFACT_NAME }} name: ${{ matrix.variant.name }}
path: artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }} path: artifacts/${{ matrix.variant.name }}
+1
View File
@@ -6,6 +6,7 @@ on:
- master - master
paths: paths:
- server/** - server/**
- .github/workflows/server_test.yml
jobs: jobs:
server_test: server_test:
+4 -2
View File
@@ -1,4 +1,4 @@
name: Deploy to GitHub Pages name: Build and Deploy Webpage to GitHub Pages
on: on:
push: push:
@@ -6,10 +6,11 @@ on:
- master - master
paths: paths:
- webpage/** - webpage/**
- .github/workflows/webpage_deploy.yml
jobs: jobs:
webpage_build: webpage_build:
name: Build Docusaurus name: Build and Deploy Webpage to GitHub Pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -25,6 +26,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
working-directory: ./webpage working-directory: ./webpage
run: npm ci run: npm ci
- name: Build webpage - name: Build webpage
working-directory: ./webpage working-directory: ./webpage
run: npm run build run: npm run build
+1
View File
@@ -6,6 +6,7 @@ on:
- master - master
paths: paths:
- webpage/** - webpage/**
- .github/workflows/webpage_test.yml
jobs: jobs:
webpage_test: webpage_test: