55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
name: Test & Build Holiday Property Booking
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- qa
|
|
- master
|
|
- main
|
|
|
|
jobs:
|
|
test-build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
github-server-url: https://git.dumas.ddns.net
|
|
|
|
- name: Check existing Node.js
|
|
id: node-check
|
|
shell: bash
|
|
run: |
|
|
set -Eeuo pipefail
|
|
|
|
if command -v node >/dev/null 2>&1; then
|
|
node_version="$(node -p 'process.versions.node')"
|
|
node_major="${node_version%%.*}"
|
|
|
|
if [ "$node_major" = "20" ]; then
|
|
echo "use_existing_node=true" >> "$GITHUB_OUTPUT"
|
|
echo "Node.js $node_version already available; skipping setup-node"
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
echo "use_existing_node=false" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Setup Node.js
|
|
if: steps.node-check.outputs.use_existing_node != 'true'
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Build
|
|
run: npm run build
|