mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
82 lines
2.3 KiB
YAML
82 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '17'
|
|
cache: maven
|
|
- name: Build and test
|
|
run: mvn -B verify
|
|
|
|
electron-build:
|
|
name: Electron packages (${{ matrix.os }})
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
build-command: npx electron-builder --linux AppImage --publish never
|
|
artifact-name: electron-linux
|
|
- os: windows-latest
|
|
build-command: npx electron-builder --win nsis --publish never
|
|
artifact-name: electron-windows
|
|
- os: macos-latest
|
|
build-command: npx electron-builder --mac --publish never
|
|
artifact-name: electron-macos
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: package-lock.json
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build Electron bundles
|
|
run: ${{ matrix.build-command }}
|
|
- name: Upload Electron artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: |
|
|
dist/*.AppImage
|
|
dist/*.exe
|
|
dist/*.dmg
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: kruhlmann
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
tags: |
|
|
kruhlmann/imgfloat-j:latest
|
|
kruhlmann/imgfloat-j:${{ github.sha }}
|