Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix-frontend-fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Feb 22, 2024
2 parents 8af354d + 4024461 commit 4a92e75
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CD

on:
workflow_dispatch:
pull_request:
push:
branches:
- "main"
tags:
- "v*"

env:
DOCKERHUB_USERNAME: vocksel
DOCKERHUB_REPO: swatch

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}

- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: ./server
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Lint
run: just lint
- run: just lint

- name: Get model file name
run: |
Expand Down
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
version: "3"
services:
lune-server:
container_name: lune-server
build:
dockerfile: server/Dockerfile
args:
- LUNE_VERSION=0.7.11
swatch-api:
container_name: swatch-api
build: ./server
ports:
- "8080:8080"
volumes:
- ./server/src:/app/server
command: ["lune", "run", "server/server.luau"]
9 changes: 3 additions & 6 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

FROM rust:1.75.0 AS build-lune

ARG LUNE_VERSION

RUN apt-get update && apt-get install -y git gcc

# HACK: Need to install Lune from its main branch to bind servers to 0.0.0.0
RUN git clone https://github.com/lune-org/lune
RUN cargo build --release --manifest-path lune/Cargo.toml

# RUN curl -LJO https://github.com/lune-org/lune/releases/download/v${LUNE_VERSION}/lune-${LUNE_VERSION}-linux-aarch64.zip
# RUN unzip *.zip

FROM ubuntu:24.04 AS server

EXPOSE 8080
VOLUME [ "/app/server" ]
WORKDIR /app
COPY ./src /app/server

# The server spawns processes for these commands
RUN apt-get update && apt-get install -y curl unzip

COPY --from=build-lune ./lune/target/release/lune /usr/local/bin

CMD ["lune", "run", "server/server.luau"]

0 comments on commit 4a92e75

Please sign in to comment.