74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
name: Server CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ '**' ]
|
|
paths:
|
|
- 'CollabTableServer/**'
|
|
- '.github/workflows/server-ci.yml'
|
|
pull_request:
|
|
branches: [ '**' ]
|
|
paths:
|
|
- 'CollabTableServer/**'
|
|
- '.github/workflows/server-ci.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: CollabTableServer
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: CollabTableServer/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run ESLint
|
|
run: npm run lint
|
|
|
|
build-and-push:
|
|
name: Build & Push Docker Image
|
|
needs: lint
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./CollabTableServer
|
|
push: ${{ github.event_name == 'push' }}
|
|
tags: |
|
|
gabriel20xx/CollabTableServer:latest
|
|
gabriel20xx/CollabTableServer:${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|