Skip to content

Bump node from 16-alpine to 23-alpine #1543

Bump node from 16-alpine to 23-alpine

Bump node from 16-alpine to 23-alpine #1543

Workflow file for this run

name: PHP, Node.js, and Docker CI
on:
push:
branches: [ 2.x ]
pull_request:
branches: [ 2.x ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
php-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: [ '8.3' ] # See https://www.php.net/supported-versions.php
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run Composer check
run: vendor/bin/grumphp run --testsuite=composer
- name: Run checks
run: vendor/bin/grumphp run --testsuite=check
- name: Run test suite
run: vendor/bin/simple-phpunit
node-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 22.x ] # See https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- if: matrix.node-version != '18.x'
run: npm run build
- if: matrix.node-version == '18.x'
run: NODE_OPTIONS=--openssl-legacy-provider npm run build
- uses: actions/upload-artifact@v4
with:
name: assets-${{ matrix.node-version }}
path: public/build
# - run: npm test
node-eslint:
runs-on: ubuntu-latest
needs: node-build
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint --if-present
node-geojsonhint:
runs-on: ubuntu-latest
needs: node-build
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run geojsonhint --if-present
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}