add server and test build for pull requests.

This commit is contained in:
Miroslav Šedivý 2025-02-23 12:15:15 +01:00
parent d5a2b3f57d
commit 9d1d30fc6b
5 changed files with 69 additions and 40 deletions

View file

@ -1,19 +1,15 @@
name: Test Website Build name: Test Client Build
on: on:
pull_request: pull_request:
branches: branches:
- master - master
defaults:
run:
shell: bash
working-directory: ./website
jobs: jobs:
website_test: client_test:
name: Test Website Build name: Test Client Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -22,8 +18,11 @@ jobs:
with: with:
node-version: 18 node-version: 18
cache: npm cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies - name: Install dependencies
working-directory: ./client
run: npm ci run: npm ci
- name: Build website - name: Build client
working-directory: ./client
run: npm run build run: npm run build

View file

@ -1,21 +0,0 @@
name: Build a Docker image
on:
pull_request:
branches:
- master
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./server/

23
.github/workflows/server_test.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Test Server Build
on:
pull_request:
branches:
- master
jobs:
server_test:
name: Test Server Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: ./server

View file

@ -5,15 +5,11 @@ on:
branches: branches:
- master - master
defaults:
run:
shell: bash
working-directory: ./website
jobs: jobs:
website_build: webpage_build:
name: Build Docusaurus name: Build Docusaurus
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -22,20 +18,24 @@ jobs:
with: with:
node-version: 18 node-version: 18
cache: npm cache: npm
cache-dependency-path: webpage/package-lock.json
- name: Install dependencies - name: Install dependencies
working-directory: ./webpage
run: npm ci run: npm ci
- name: Build website - name: Build webpage
working-directory: ./webpage
run: npm run build run: npm run build
- name: Upload Build Artifact - name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: build artifact-name: github-pages
path: ./webpage/build
website_deploy: webpage_deploy:
name: Deploy to GitHub Pages name: Deploy to GitHub Pages
needs: website_build needs: webpage_build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions: permissions:

28
.github/workflows/webpage_test.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Test Webpage Build
on:
pull_request:
branches:
- master
jobs:
webpage_test:
name: Test Webpage Build
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: webpage/package-lock.json
- name: Install dependencies
working-directory: ./webpage
run: npm ci
- name: Build webpage
working-directory: ./webpage
run: npm run build