Skip to content

Commit 86c7c9e

Browse files
armanddidierjeanBirdieECL
authored andcommitted
Add build workflow
Use adapter Node Add docker file Typo typo Copy .env Entrypoint typo Dockerfile Add docker-compose remove dotenv prod add env prod Use - for url Use a - for the url # Conflicts: # .env.production # bun.lockb # package.json
1 parent 2faefdf commit 86c7c9e

File tree

6 files changed

+72
-7
lines changed

6 files changed

+72
-7
lines changed

.env.production

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
PUBLIC_DISPLAY_PLAY_URL="fuiz.us"
2-
PUBLIC_PLAY_URL="https://fuiz.us"
3-
PUBLIC_BACKEND_URL="https://api.fuiz.us"
4-
PUBLIC_WS_URL="wss://api.fuiz.us"
5-
PUBLIC_CORKBOARD_URL="https://corkboard.fuiz.us"
1+
PUBLIC_DISPLAY_PLAY_URL="fuiz.dev.eclair.ec-lyon.fr"
2+
PUBLIC_PLAY_URL="https://fuiz.dev.eclair.ec-lyon.fr"
3+
PUBLIC_BACKEND_URL="https://api-fuiz.dev.eclair.ec-lyon.fr"
4+
PUBLIC_WS_URL="wss://api-fuiz.dev.eclair.ec-lyon.fr"
5+
PUBLIC_CORKBOARD_URL="https://corkboard-fuiz.dev.eclair.ec-lyon.fr"
66
PUBLIC_GOOGLE="false"
7-
REDIRECT_URI="https://fuiz.us/google/callback"
7+
REDIRECT_URI="https://fuiz.us/google/callback"

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Publish fuiz-website
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
12+
steps:
13+
- name: Check out the code
14+
uses: actions/checkout@v4
15+
16+
- name: Install bun
17+
uses: oven-sh/setup-bun@v1
18+
19+
- name: Install dependencies
20+
run: bun install
21+
22+
- name: Build site
23+
run: bun run build
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to GitHub Container Registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
32+
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
33+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
34+
35+
- name: Build and push
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
platforms: linux/amd64 #,linux/arm64
40+
push: true
41+
tags: |
42+
${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/fuiz_website:latest

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
FROM oven/bun:1 as install
3+
4+
RUN mkdir -p /temp/prod
5+
#COPY /temp/prod /temp/prod
6+
COPY package.json bun.lockb /temp/prod/
7+
RUN cd /temp/prod && bun install --production --frozen-lockfile
8+
9+
10+
FROM node:19-bullseye as base
11+
COPY --from=install /temp/prod/node_modules node_modules
12+
13+
COPY /build /build
14+
15+
COPY package-build.json /build/package.json
16+
17+
ENTRYPOINT ["node", "-r", "dotenv/config", "build"]

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
web:
3+
build: .
4+
ports:
5+
- '3000:3000'

package-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"type": "module"}

svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import adapter from '@sveltejs/adapter-cloudflare';
1+
import adapter from '@sveltejs/adapter-node';
22
import { importAssets } from 'svelte-preprocess-import-assets';
33
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
44
import { mdsvex } from 'mdsvex';

0 commit comments

Comments
 (0)