Skip to content

Commit

Permalink
Merge pull request #132 from thanhdanh27600/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
thanhdanh27600 authored Aug 28, 2023
2 parents 8aa7459 + 5ce0471 commit b04e740
Show file tree
Hide file tree
Showing 50 changed files with 1,790 additions and 372 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"extends": "next/core-web-vitals",
"rules": {
"react-hooks/exhaustive-deps": "off",
"react-hooks/exhaustive-deps": 0,
"react/jsx-no-target-blank": "off",
"no-unexpected-multiline": 2,
"no-implied-eval": 2,
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ jobs:
NEXT_PUBLIC_SHORT_DOMAIN=false
push: true
tags: ghcr.io/${{ github.repository }}:latest
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Deploy using ssh
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
# port: 22
# script: |
# cd ~/clickdi
# sh ./backup.sh
# docker login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
# docker compose pull
# docker compose down
# docker compose up -d
# docker system prune -f
# sh ./migrate.sh
# sh ./puppeteer.sh
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22
script: |
cd ~/clickdi
# sh ./backup.sh
sudo docker login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
sudo docker compose down
sudo docker compose pull
sudo docker compose up -d
sudo sh ./migrate.sh
sudo sh ./puppeteer.sh
sudo docker system prune -f
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ RUN npm install sharp
FROM dependencies AS builder
WORKDIR /app
COPY . .
RUN chmod -R 777 ./scripts
RUN if [ "$NEXT_PUBLIC_SHORT_DOMAIN" = "true" ] ; then ./scripts/short_clean_build.sh; else echo 'Keep building original src'; fi
RUN npm run build
RUN chmod -R 777 ./prisma

Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
},
"dependencies": {
"@cloudamqp/amqp-client": "^2.1.1",
"@hookform/error-message": "^2.0.1",
"@prisma/client": "4.9.0",
"@styled-icons/feather": "^10.47.0",
"@tailwindcss/line-clamp": "^0.4.2",
"@textea/json-viewer": "^2.16.0",
"@types/jest": "^29.5.2",
"@types/nodemailer": "^6.4.9",
"@types/ramda": "^0.29.3",
"add": "^2.0.6",
"axios": "^1.2.6",
"clsx": "^1.2.1",
Expand All @@ -44,19 +46,21 @@
"prisma": "^4.9.0",
"puppeteer": "^19.7.1",
"qrcode": "^1.5.1",
"ramda": "^0.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.42.1",
"react-hook-form": "^7.45.4",
"react-hot-toast": "^2.4.1",
"react-i18next": "^13.2.0",
"react-query": "^3.39.3",
"request-ip": "^3.3.0",
"sass": "^1.57.1",
"styled-components": "^5.3.8",
"styled-components": "^6.0.7",
"ts-jest": "^29.1.0",
"ua-parser-js": "^1.0.34",
"yarn": "^1.22.19",
"zod": "^3.20.6"
"zod": "^3.20.6",
"zustand": "^4.4.1"
},
"devDependencies": {
"@types/crypto-js": "^4.1.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "UrlShortenerHistory" ADD COLUMN "ogDescription" TEXT,
ADD COLUMN "ogDomain" TEXT,
ADD COLUMN "ogImgSrc" TEXT,
ADD COLUMN "ogTitle" TEXT;
23 changes: 12 additions & 11 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ model UrlShortenerHistory {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
url String
hash String @unique
email String?
password String?
url String
hash String @unique
email String?
password String?
ogTitle String?
ogDomain String?
ogDescription String?
ogImgSrc String?
UrlShortenerRecord UrlShortenerRecord @relation(fields: [urlShortenerRecordId], references: [id], onDelete: Cascade)
urlShortenerRecordId Int
urlForwardMeta UrlForwardMeta[]
urlForwardMeta UrlForwardMeta[]
}

model UrlForwardMeta {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userAgent String?
countryCode String?
ip String?
Expand Down
Binary file added public/assets/clickdi-banner-en.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/clickdi-banner-vi.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b04e740

Please sign in to comment.