Skip to content

Commit

Permalink
Merge pull request #43 from Floorp-Projects/dev
Browse files Browse the repository at this point in the history
Merging dev to production
  • Loading branch information
regularentropy authored May 29, 2024
2 parents d3a2884 + a524368 commit 879f0e0
Show file tree
Hide file tree
Showing 123 changed files with 11,788 additions and 14,301 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV=production
SELF_URL=https://devtest.kou-gen.net
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Image CI

on:
push:
branches:
- dev
- master

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

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

- name: Log in to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH }}

- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
# Image name should be lowercase and: ghcr.io/<repo>-<branch>:latest
- name: Get the image name
run: echo "IMAGE_NAME=ghcr.io/${{ env.REPO }}-${{ github.ref_name }}" >>${GITHUB_ENV}

- name: Build and push container hashed image to registry
uses: docker/build-push-action@v4
with:
platforms: amd64,arm64
push: true
# Hashed and latest tags
tags: ${{ env.IMAGE_NAME }}:${{ github.sha }}, ${{ env.IMAGE_NAME }}:latest
file: ./Dockerfile
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ yarn-error.log*

# local env files
.env*.local
!.env

# vercel
.vercel

.idea/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "i18n/dictionaries"]
path = i18n/dictionaries
url = https://github.com/Floorp-Projects/web-i18n.git
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
20.13.1
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:lts as dependencies

WORKDIR /app
COPY package.json ./
RUN npm install

FROM node:lts as builder
WORKDIR /app
ENV NODE_ENV production
ENV TZ=Asia/Tokyo
COPY . .
COPY --from=dependencies /app/node_modules ./node_modules

RUN npm run build

FROM node:lts as runner

WORKDIR /app
ENV NODE_ENV production
ENV BASE_URL=http://localhost:8887
ENV NEXT_TELEMETRY_DISABLED 1
ENV TZ=Asia/Tokyo

COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/*.ts ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/i18n ./i18n

EXPOSE 3000

CMD ["npm", "start"]
Loading

0 comments on commit 879f0e0

Please sign in to comment.