Skip to content

Commit

Permalink
Merge pull request #74 from Etherna/cms-monorepo
Browse files Browse the repository at this point in the history
Cms monorepo
  • Loading branch information
mattiaz9 authored Mar 24, 2024
2 parents cfe6a5e + cf84fec commit 37fd405
Show file tree
Hide file tree
Showing 512 changed files with 33,621 additions and 10,197 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
.turbo
.rollup.cache
node_modules
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

11 changes: 0 additions & 11 deletions .env.example

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc.js

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/main.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Deploy on Hosting

on:
push:
paths:
- apps/web/**
branches:
- main
- develop
Expand All @@ -16,12 +18,10 @@ jobs:
name: ${{ endsWith(github.ref, '/main') && 'production' || 'development' }}

env:
PUBLIC_DIRECTUS_URL: ${{ secrets.PUBLIC_DIRECTUS_URL }}
PUBLIC_DIRECTUS_PROJECT: ${{ secrets.PUBLIC_DIRECTUS_PROJECT }}
DIRECTUS_PROJECT: "etherna"
DIRECTUS_TOKEN: ${{ secrets.DIRECTUS_TOKEN }}
DISABLE_SOURCEMAP: "true"
SITE_URL: "https://info.etherna.io"
PUBLIC_SITE_URL: "https://info.etherna.io"
PUBLIC_DIRECTUS_URL: "https://cms.etherna.io"
ANALYTICS_URL: "https://analytics.etherna.io"
ANALYTICS_SITE_ID: "1"

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -109,4 +109,4 @@ jobs:
ethernaApiKey: ${{ secrets.ETHERNA_API_KEY }}
batchId: ${{ secrets.BATCH_ID }}
feedName: EthernaWebsite
feedType: epoch
feedType: epoch
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish on Docker Hub

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: etherna/etherna-cms
tags: |
type=semver,pattern=v{{major}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
95 changes: 30 additions & 65 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,79 +1,44 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# yarn 2
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# dependencies
node_modules
.pnp
.pnp.js

# Coverage directory used by tools like istanbul
# testing
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled
# next.js
.next/
out/
build
dist

# Dependency directories
node_modules/
jspm_packages/
# misc
.DS_Store
*.pem
*.tsbuildinfo

# Optional npm cache directory
.npm
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Optional eslint cache
.eslintcache
# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Optional REPL history
.node_repl_history
# turbo
.turbo

# Output of 'npm pack'
*.tgz
# vercel
.vercel

# dotenv environment variable files
# env
.env*
!.env.example

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js

# Yarn Integrity file
.yarn-integrity

# Other
deploy*

test*.ts
# docker
docker-compose.yml
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

24 changes: 7 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{
"editor.formatOnSave": true,
"path-autocomplete.pathMappings": {
"@/": "${folder}/src"
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"files.associations": {
"*.css": "tailwindcss"
},
"eslint.validate": ["typescript", "typescriptreact"],
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"tailwindCSS.validate": true
}
}
13 changes: 0 additions & 13 deletions .vscode/templates/html.lict

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/templates/mjs.lict

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/templates/scss.lict

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/templates/ts.lict

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/templates/tsx.lict

This file was deleted.

15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:latest AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN pnpm install --force --frozen-lockfile
RUN pnpm run build:cms

FROM directus/directus
ENV ADMIN_EMAIL="admin@example.com"
ENV ADMIN_PASSWORD="d1r3ctu5"
COPY --from=build ./usr/src/app/apps/cms/snapshot.yaml ./snapshot.yaml
COPY --from=build ./usr/src/app/apps/cms/extensions ./extensions
CMD node cli.js bootstrap && node cli.js database migrate:latest && node cli.js schema apply --yes ./snapshot.yaml && node cli.js start
Loading

0 comments on commit 37fd405

Please sign in to comment.