43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
name: Build
|
|
on:
|
|
push: {}
|
|
pull_request: {}
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
version: [18, 20, 22]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4.1.2
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4.0.2
|
|
with:
|
|
node-version: ${{ matrix.version }}
|
|
- run: npm ci
|
|
- run: cp config.json.example config.json
|
|
- run: echo '{"version":"","buildLabel":"","matchmakingBuildId":""}' > static/data/buildConfig.json
|
|
- run: npm run build
|
|
- run: npm run lint
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Set up Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}:latest
|
|
ghcr.io/${{ github.repository}}:${{ github.sha }}
|