diff --git a/.dockerignore b/.dockerignore index cfabe27..0bd563a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,26 +3,14 @@ # next.js /.next/ -/out/ next-env.d.ts -# production -/build - # misc .DS_Store -# local env files -.env -.env*.local - # typescript *.tsbuildinfo -# site map -public/sitemap.xml -public/robots.txt - # docker Dockerfile* .dockerignore diff --git a/.env.example b/.env.example index f407f4e..67a64b3 100644 --- a/.env.example +++ b/.env.example @@ -8,7 +8,6 @@ # When adding additional environment variables, the schema in "/src/env.js" # should be updated accordingly. -# The ARGS in docker-compose.yml and the Dockerfile must also be updated. # Also update any GitHub Actions that use these variables. # General diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..2206742 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Executing remote SSH commands using SSH key + uses: appleboy/ssh-action@master + with: + username: ${{ secrets.USERNAME }} + host: ${{ secrets.HOST }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + git pull + bun run build + cd docs + docker compose down + docker compose up -d diff --git a/.gitignore b/.gitignore index c55f229..b8a2932 100644 --- a/.gitignore +++ b/.gitignore @@ -3,18 +3,13 @@ # next.js /.next/ -/out/ next-env.d.ts -# production -/build - # misc .DS_Store # local env files .env -.env*.local # typescript *.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index a2f4ee5..b6bf37f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,41 +20,6 @@ COPY . . ENV NODE_ENV=production ENV SKIP_ENV_VALIDATION=true -# Set environment variables during the build -ARG NEXT_PUBLIC_SITE_URL -ARG DATABASE_USER -ARG DATABASE_PASSWORD -ARG DATABASE_HOST -ARG DATABASE_PORT -ARG DATABASE_NAME -ARG STORAGE_HOST -ARG STORAGE_PORT -ARG STORAGE_USER -ARG STORAGE_PASSWORD -ARG STORAGE_NAME -ARG FEIDE_CLIENT_ID -ARG FEIDE_CLIENT_SECRET -ARG FEIDE_AUTHORIZATION_ENDPOINT -ARG FEIDE_TOKEN_ENDPOINT -ARG FEIDE_USERINFO_ENDPOINT - -ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL -ENV DATABASE_USER=$DATABASE_USER -ENV DATABASE_PASSWORD=$DATABASE_PASSWORD -ENV DATABASE_HOST=$DATABASE_HOST -ENV DATABASE_PORT=$DATABASE_PORT -ENV DATABASE_NAME=$DATABASE_NAME -ENV STORAGE_HOST=$STORAGE_HOST -ENV STORAGE_PORT=$STORAGE_PORT -ENV STORAGE_USER=$STORAGE_USER -ENV STORAGE_PASSWORD=$STORAGE_PASSWORD -ENV STORAGE_NAME=$STORAGE_NAME -ENV FEIDE_CLIENT_ID=$FEIDE_CLIENT_ID -ENV FEIDE_CLIENT_SECRET=$FEIDE_CLIENT_SECRET -ENV FEIDE_AUTHORIZATION_ENDPOINT=$FEIDE_AUTHORIZATION_ENDPOINT -ENV FEIDE_TOKEN_ENDPOINT=$FEIDE_TOKEN_ENDPOINT -ENV FEIDE_USERINFO_ENDPOINT=$FEIDE_USERINFO_ENDPOINT - # Build the application RUN bun run build diff --git a/docker-compose.yml b/docker-compose.yml index 0466607..50e0d20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,25 +5,6 @@ services: build: context: . dockerfile: Dockerfile - args: - - DATABASE_HOST - - DATABASE_PORT - - DATABASE_USER - - DATABASE_PASSWORD - - DATABASE_NAME - - STORAGE_HOST - - STORAGE_PORT - - STORAGE_USER - - STORAGE_PASSWORD - - STORAGE_NAME - - FEIDE_CLIENT_ID - - FEIDE_CLIENT_SECRET - - FEIDE_AUTHORIZATION_ENDPOINT - - FEIDE_TOKEN_ENDPOINT - - FEIDE_USERINFO_ENDPOINT - - NEXT_PUBLIC_SITE_URL - env_file: - - .env ports: - "3000:3000" db: diff --git a/package.json b/package.json index eb8257b..fc02ee3 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "lint": "biome check --write", "prebuild": "next telemetry disable", "build": "next build", - "postbuild": "next-sitemap && mkdir -p .next/standalone/public && mkdir -p .next/standalone/.next/static && cp -R public/* .next/standalone/public/ && cp -R .next/static/* .next/standalone/.next/static/", "start": "bun run .next/standalone/server.js", "db:start": "docker-compose up db", "db:generate": "drizzle-kit generate",