Skip to content

Commit

Permalink
Build CI image
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Feb 29, 2024
1 parent 4af4bfe commit 5861c81
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: registry

on:
workflow_dispatch:
schedule:
- cron: '0 17 * * *'
push:
paths:
- '.github/workflows/ci-image.yml'
- 'conf/ci.conf'
- 'docker/ci.Dockerfile'

jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/ci.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 9 additions & 0 deletions conf/ci.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include "base"
include "version"

user.password.bpass.secret = "9qEYN0ThHer1KWLNekA76Q=="

net.ratelimit = false

mongodb.uri = ${?MONGO_URL}
redis.uri = ${?REDIS_URL}
10 changes: 10 additions & 0 deletions docker/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_3.3.1

RUN git clone --depth 1 https://github.com/lichess-org/lila.git /lila

COPY conf/ci.conf /lila/conf/application.conf

WORKDIR /lila
RUN ./lila stage

ENTRYPOINT sleep 10 && JAVA_OPTS="-Xms4g -Xmx4g" ./target/universal/stage/bin/lila -Dconfig.file="/lila/conf/application.conf" -Dlogger.file="/lila/conf/logger.dev.xml"

0 comments on commit 5861c81

Please sign in to comment.