Skip to content

Commit

Permalink
Add build workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
armanddidierjean authored and BirdieECL committed Nov 16, 2024
1 parent 2faefdf commit 86c7c9e
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PUBLIC_DISPLAY_PLAY_URL="fuiz.us"
PUBLIC_PLAY_URL="https://fuiz.us"
PUBLIC_BACKEND_URL="https://api.fuiz.us"
PUBLIC_WS_URL="wss://api.fuiz.us"
PUBLIC_CORKBOARD_URL="https://corkboard.fuiz.us"
PUBLIC_DISPLAY_PLAY_URL="fuiz.dev.eclair.ec-lyon.fr"
PUBLIC_PLAY_URL="https://fuiz.dev.eclair.ec-lyon.fr"
PUBLIC_BACKEND_URL="https://api-fuiz.dev.eclair.ec-lyon.fr"
PUBLIC_WS_URL="wss://api-fuiz.dev.eclair.ec-lyon.fr"
PUBLIC_CORKBOARD_URL="https://corkboard-fuiz.dev.eclair.ec-lyon.fr"
PUBLIC_GOOGLE="false"
REDIRECT_URI="https://fuiz.us/google/callback"
REDIRECT_URI="https://fuiz.us/google/callback"
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Publish fuiz-website
on:
push:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out the code
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Build site
run: bun run build

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64 #,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/fuiz_website:latest
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

FROM oven/bun:1 as install

RUN mkdir -p /temp/prod
#COPY /temp/prod /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --production --frozen-lockfile


FROM node:19-bullseye as base
COPY --from=install /temp/prod/node_modules node_modules

COPY /build /build

COPY package-build.json /build/package.json

ENTRYPOINT ["node", "-r", "dotenv/config", "build"]
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
web:
build: .
ports:
- '3000:3000'
1 change: 1 addition & 0 deletions package-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "module"}
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-cloudflare';
import adapter from '@sveltejs/adapter-node';
import { importAssets } from 'svelte-preprocess-import-assets';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex';
Expand Down

0 comments on commit 86c7c9e

Please sign in to comment.