fix: change font
This commit is contained in:
@@ -0,0 +1,65 @@
|
|||||||
|
name: mws-frontend
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKERHUB_REPO: mws-frontend
|
||||||
|
CONTAINER_NAME: mws-frontend
|
||||||
|
HOST_PORT: "3000"
|
||||||
|
CONTAINER_PORT: "80"
|
||||||
|
VITE_API_BASE_URL: https://mws-api.koda.id.vn
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
IMAGE_BASE="${{ secrets.REGISTRY_USER }}/${{ env.DOCKERHUB_REPO }}"
|
||||||
|
docker build \
|
||||||
|
--build-arg VITE_API_BASE_URL="${{ env.VITE_API_BASE_URL }}" \
|
||||||
|
-t "$IMAGE_BASE:${{ github.sha }}" \
|
||||||
|
-t "$IMAGE_BASE:latest" .
|
||||||
|
|
||||||
|
push:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Login and push to Docker Hub
|
||||||
|
run: |
|
||||||
|
IMAGE_BASE="${{ secrets.REGISTRY_USER }}/${{ env.DOCKERHUB_REPO }}"
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
docker push "$IMAGE_BASE:${{ github.sha }}"
|
||||||
|
docker push "$IMAGE_BASE:latest"
|
||||||
|
docker logout
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: push
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Pull & run new container
|
||||||
|
run: |
|
||||||
|
IMAGE_BASE="${{ secrets.REGISTRY_USER }}/${{ env.DOCKERHUB_REPO }}"
|
||||||
|
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
docker pull "$IMAGE_BASE:${{ github.sha }}"
|
||||||
|
docker logout
|
||||||
|
|
||||||
|
docker stop "${{ env.CONTAINER_NAME }}" 2>/dev/null || true
|
||||||
|
docker rm "${{ env.CONTAINER_NAME }}" 2>/dev/null || true
|
||||||
|
|
||||||
|
docker run -d \
|
||||||
|
--name "${{ env.CONTAINER_NAME }}" \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p "${{ env.HOST_PORT }}:${{ env.CONTAINER_PORT }}" \
|
||||||
|
"$IMAGE_BASE:${{ github.sha }}"
|
||||||
|
|
||||||
|
docker images "$IMAGE_BASE" --format '{{.Repository}}:{{.Tag}}' \
|
||||||
|
| grep -v -e ':latest$' -e ":${{ github.sha }}$" \
|
||||||
|
| xargs -r docker rmi || true
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
stages:
|
|
||||||
- build
|
|
||||||
- push
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
variables:
|
|
||||||
DOCKERHUB_REPO: "mws-frontend"
|
|
||||||
CONTAINER_NAME: "mws-frontend"
|
|
||||||
HOST_PORT: "3000"
|
|
||||||
CONTAINER_PORT: "80"
|
|
||||||
DEPLOY_SSH_PORT: "8686"
|
|
||||||
VITE_API_BASE_URL: "https://mws-api.koda.id.vn"
|
|
||||||
|
|
||||||
default:
|
|
||||||
tags:
|
|
||||||
- deploy
|
|
||||||
- build
|
|
||||||
|
|
||||||
workflow:
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"'
|
|
||||||
- when: never
|
|
||||||
|
|
||||||
build:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- IMAGE_BASE="$REGISTRY_USER/$DOCKERHUB_REPO"
|
|
||||||
- docker build --build-arg VITE_API_BASE_URL="$VITE_API_BASE_URL" -t "$IMAGE_BASE:$CI_COMMIT_SHORT_SHA" -t "$IMAGE_BASE:latest" .
|
|
||||||
|
|
||||||
push:
|
|
||||||
stage: push
|
|
||||||
script:
|
|
||||||
- IMAGE_BASE="$REGISTRY_USER/$DOCKERHUB_REPO"
|
|
||||||
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin
|
|
||||||
- docker push "$IMAGE_BASE:$CI_COMMIT_SHORT_SHA"
|
|
||||||
- docker push "$IMAGE_BASE:latest"
|
|
||||||
- docker logout
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
stage: deploy
|
|
||||||
environment:
|
|
||||||
name: production
|
|
||||||
before_script:
|
|
||||||
- command -v ssh-agent >/dev/null 2>&1 || (apt-get update -y && apt-get install -y openssh-client)
|
|
||||||
- eval "$(ssh-agent -s)"
|
|
||||||
- chmod 600 "$SSH_PRIVATE_KEY"
|
|
||||||
- ssh-add "$SSH_PRIVATE_KEY"
|
|
||||||
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
||||||
- ssh-keyscan -p "$DEPLOY_SSH_PORT" -H "$DEPLOYER_HOST" >> ~/.ssh/known_hosts 2>/dev/null
|
|
||||||
- chmod 644 ~/.ssh/known_hosts
|
|
||||||
script:
|
|
||||||
- IMAGE_BASE="$REGISTRY_USER/$DOCKERHUB_REPO"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "echo '$REGISTRY_PASSWORD' | docker login -u '$REGISTRY_USER' --password-stdin"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker pull '$IMAGE_BASE:$CI_COMMIT_SHORT_SHA'"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker stop '$CONTAINER_NAME' 2>/dev/null || true"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker rm '$CONTAINER_NAME' 2>/dev/null || true"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker run -d --name '$CONTAINER_NAME' --restart unless-stopped -p '$HOST_PORT:$CONTAINER_PORT' '$IMAGE_BASE:$CI_COMMIT_SHORT_SHA'"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker images '$IMAGE_BASE' --format '{{.Repository}}:{{.Tag}}' | grep -v -e ':latest$' -e ':$CI_COMMIT_SHORT_SHA$' | xargs -r docker rmi || true"
|
|
||||||
- ssh -p "$DEPLOY_SSH_PORT" "$DEPLOYER_USER@$DEPLOYER_HOST" "docker logout"
|
|
||||||
+1
-11
@@ -7,20 +7,10 @@
|
|||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap"
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
<title>My Workspace</title>
|
<title>My Workspace</title>
|
||||||
<script>
|
|
||||||
;(function () {
|
|
||||||
var stored = localStorage.getItem('mws_theme')
|
|
||||||
var dark =
|
|
||||||
stored === 'dark' ||
|
|
||||||
(stored !== 'light' &&
|
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches)
|
|
||||||
if (dark) document.documentElement.classList.add('app-dark')
|
|
||||||
})()
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
+5
-3
@@ -17,9 +17,11 @@ function landingPath(): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fallbackLocation() {
|
function fallbackLocation() {
|
||||||
|
const auth = useAuthStore()
|
||||||
const last = localStorage.getItem('mws_last_project')
|
const last = localStorage.getItem('mws_last_project')
|
||||||
if (last) return { name: 'tasks-board', params: { id: last } }
|
const canOpenTasks = !auth.menuLoaded || auth.canView('tasks')
|
||||||
return landingPath()
|
if (last && canOpenTasks) return { name: 'tasks-board', params: { id: last } }
|
||||||
|
return { name: 'select-project' }
|
||||||
}
|
}
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
@@ -91,7 +93,7 @@ router.beforeEach(async (to) => {
|
|||||||
if (to.meta.adminOnly && !auth.isAdmin) {
|
if (to.meta.adminOnly && !auth.isAdmin) {
|
||||||
return fallbackLocation()
|
return fallbackLocation()
|
||||||
}
|
}
|
||||||
if (to.meta.screenKey && !auth.canView(to.meta.screenKey)) {
|
if (to.meta.screenKey && auth.menuLoaded && !auth.canView(to.meta.screenKey)) {
|
||||||
return fallbackLocation()
|
return fallbackLocation()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-2
@@ -44,10 +44,9 @@ export const useAuthStore = defineStore('auth', {
|
|||||||
async loadMenu() {
|
async loadMenu() {
|
||||||
try {
|
try {
|
||||||
this.menu = await getMenu()
|
this.menu = await getMenu()
|
||||||
|
this.menuLoaded = true
|
||||||
} catch {
|
} catch {
|
||||||
this.menu = []
|
this.menu = []
|
||||||
} finally {
|
|
||||||
this.menuLoaded = true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchProfile() {
|
async fetchProfile() {
|
||||||
|
|||||||
+2
-3
@@ -3,9 +3,8 @@
|
|||||||
@custom-variant dark (&:where(.app-dark, .app-dark *));
|
@custom-variant dark (&:where(.app-dark, .app-dark *));
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
/* Display = Bricolage Grotesque (characterful grotesque), body = IBM Plex Sans */
|
--font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
--font-sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
--font-display: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
--font-display: 'Bricolage Grotesque', 'IBM Plex Sans', Helvetica, Arial, sans-serif;
|
|
||||||
|
|
||||||
/* Blurple — brand primary, remaps every indigo-* utility */
|
/* Blurple — brand primary, remaps every indigo-* utility */
|
||||||
--color-indigo-50: #eef0fe;
|
--color-indigo-50: #eef0fe;
|
||||||
|
|||||||
Reference in New Issue
Block a user