From 01da9b14cfe0b16ec1f3e06174413d1e6ca2f5d5 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Jan 2026 20:19:19 +0100 Subject: [PATCH] ci: add GitHub Actions workflow for server CI with linting and Docker build --- .github/workflows/server-ci.yml | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/server-ci.yml diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml new file mode 100644 index 0000000..d82ba17 --- /dev/null +++ b/.github/workflows/server-ci.yml @@ -0,0 +1,73 @@ +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