diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 966ed4e..3b0ebfb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,8 +18,8 @@ env: DEPLOY_HOST: frappet.com COMPOSE_PATH: /home/frappet/docker/bma-ehr-qualifying-cms jobs: - # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd - # act --workflows .github/workflows/release.yaml --job release --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd + # act workflow_dispatch --reuse -W .github/workflows/release.yaml --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd + # act --reuse --workflows .github/workflows/release.yaml --job release --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd release: runs-on: ubuntu-latest @@ -59,7 +59,9 @@ jobs: uses: docker/build-push-action@v3 with: context: cms - # platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64 push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - name: Remote Deployment diff --git a/cms/README.md b/cms/README.md index 82ac946..14dc2db 100644 --- a/cms/README.md +++ b/cms/README.md @@ -9,7 +9,7 @@ - [GitHub Actions](https://github.com/features/actions) ทำ CI/CD ในระบบทดสอบ - [nektos/act](https://github.com/nektos/act) ใช้ GitHub Actions บนเครื่องของเราเอง - [Argo CD](https://argo-cd.readthedocs.io/en/stable/) deploy ขึ้นระบบ Production (K8s) -- [FullCalendar](https://github.com/schooltechx/youtube/blob/main/svelte/component/FullCalendar.md) รองรับพ.ศ. ใช้แค่ฟีเจอร์[ฟรีก็น่าจะพอ](https://fullcalendar.io/license#:~:text=or%20FullCalendar%20Premium.-,FullCalendar%20Standard,all%20copyright%20headers%20are%20preserved.) +- [FullCalendar](https://github.com/schooltechx/youtube/blob/main/svelte/component/Calendar/FullCalendar.md) รองรับพ.ศ. ใช้แค่ฟีเจอร์[ฟรีก็น่าจะพอ](https://fullcalendar.io/license#:~:text=or%20FullCalendar%20Premium.-,FullCalendar%20Standard,all%20copyright%20headers%20are%20preserved.) - [Day.js](https://day.js.org/) ในฟอร์แม็ตวันในรูปแบบ local ไทยรองรับ พ.ศ. ## วีดีโอแสดงการทำงานทั้งหมด @@ -70,7 +70,7 @@ npx vite preview --port=4000 --host=0.0.0.0 ถ้าไม่ build เอง ตอนนี้มี demo อยู่ที่ [https://bma-qualifying.frappet.synology.me/](https://bma-qualifying.frappet.synology.me/) ให้เปลี่ยน base url ให้เหมาะสม -Data Type ที่ใช้ดูในไฟล์ [CMSDataType.ts](./src/lib/data/CMSDataType.ts) +การกำหนด path ของ API และ Data Type ที่ใช้ดูในไฟล์ [CMSDataType.ts](./src/lib/data/CMSDataType.ts) ## Browser Testing diff --git a/cms/src/lib/components/Footer.svelte b/cms/src/lib/components/Footer.svelte index 1631151..b16be73 100644 --- a/cms/src/lib/components/Footer.svelte +++ b/cms/src/lib/components/Footer.svelte @@ -33,7 +33,7 @@
- logo + logo
{title}
diff --git a/cms/src/lib/components/Header.svelte b/cms/src/lib/components/Header.svelte index fa5d6e2..94d4b30 100644 --- a/cms/src/lib/components/Header.svelte +++ b/cms/src/lib/components/Header.svelte @@ -2,7 +2,6 @@ export let logo_url:string = "/images/logo.png" export let title:string = "ใส่ชื่อองค์กรที่นี้" export let supervised:string = "ใส่สังกัดที่นี้" - diff --git a/cms/src/routes/about/+page.server.ts b/cms/src/routes/about/+page.server.ts index c05c91e..d63be43 100644 --- a/cms/src/routes/about/+page.server.ts +++ b/cms/src/routes/about/+page.server.ts @@ -1,8 +1,8 @@ -import {apibase} from '$lib/data/CMSDataType' +import {cmsBase} from '$lib/data/CMSDataType' import type { PageServerLoad } from './$types'; import { error } from '@sveltejs/kit'; export const load = (async ({fetch}) => { - const res = await fetch(apibase+"/content?page=about") + const res = await fetch(cmsBase+"/content/about") if(!res.ok) throw error(500, 'ไม่สามารถอ่านเนื้อหาหน้าเกี่ยวกับได้'); const {content} = await res.json() diff --git a/cms/src/routes/competitive/+page.server.ts b/cms/src/routes/competitive/+page.server.ts index dd4abbb..bfe3f87 100644 --- a/cms/src/routes/competitive/+page.server.ts +++ b/cms/src/routes/competitive/+page.server.ts @@ -1,11 +1,11 @@ -import {apibase} from '$lib/data/CMSDataType' +import {competitiveBase} from '$lib/data/CMSDataType' import { error } from '@sveltejs/kit'; import type {CalendarEvent,Exam} from '$lib/data/CMSDataType' import dayjs from 'dayjs' import type { PageServerLoad } from './$types' export const load: PageServerLoad = async ({fetch}) => { let exams:Exam[] = [] - const res = await fetch(apibase+"/competitive") + const res = await fetch(competitiveBase+"/competitive") if(!res.ok) throw error(res.status, 'ไม่สามารถอ่านข้อมูลการสอบได้'); exams = await res.json() diff --git a/cms/src/routes/competitive/[id]/+page.server.ts b/cms/src/routes/competitive/[id]/+page.server.ts index 0e6601f..5c1ae47 100644 --- a/cms/src/routes/competitive/[id]/+page.server.ts +++ b/cms/src/routes/competitive/[id]/+page.server.ts @@ -1,10 +1,10 @@ -import {apibase} from '$lib/data/CMSDataType' +import {competitiveBase} from '$lib/data/CMSDataType' import { error } from '@sveltejs/kit' import dayjs from 'dayjs' import type { PageServerLoad } from './$types' export const load: PageServerLoad = async ({params,fetch}) => { const id = params.id+"" - const res = await fetch(apibase+"/competitive/"+id) + const res = await fetch(competitiveBase+"/competitive/"+id) if(res.status==404){ throw error(404,{message:`ค้นหาข้อมูลสอบคัดเลือก ${id}ไม่พบ`}) } diff --git a/cms/src/routes/qualifying/+page.server.ts b/cms/src/routes/qualifying/+page.server.ts index a985fe8..c2b1230 100644 --- a/cms/src/routes/qualifying/+page.server.ts +++ b/cms/src/routes/qualifying/+page.server.ts @@ -1,11 +1,11 @@ -import {apibase} from '$lib/data/CMSDataType' +import {qualifyingBase} from '$lib/data/CMSDataType' import { error } from '@sveltejs/kit'; import type {CalendarEvent,Exam} from '$lib/data/CMSDataType' import dayjs from 'dayjs' import type { PageServerLoad } from './$types' export const load: PageServerLoad = async ({fetch}) => { let exams:Exam[] = [] - const res = await fetch(apibase+"/qualifying") + const res = await fetch(qualifyingBase+"/qualifying") if(!res.ok) throw error(res.status, 'ไม่สามารถอ่านข้อมูลการสอบได้'); exams = await res.json() diff --git a/cms/src/routes/qualifying/[id]/+page.server.ts b/cms/src/routes/qualifying/[id]/+page.server.ts index fbd9445..b5cfaa2 100644 --- a/cms/src/routes/qualifying/[id]/+page.server.ts +++ b/cms/src/routes/qualifying/[id]/+page.server.ts @@ -1,10 +1,10 @@ -import {apibase} from '$lib/data/CMSDataType' +import {qualifyingBase} from '$lib/data/CMSDataType' import { error } from '@sveltejs/kit' import dayjs from 'dayjs' import type { PageServerLoad } from './$types' export const load: PageServerLoad = async ({params,fetch}) => { const id = params.id+"" - const res = await fetch(apibase+"/qualifying/"+id) + const res = await fetch(qualifyingBase+"/qualifying/"+id) if(res.status==404){ throw error(404,{message:`ค้นหาข้อมูลสอบคัดเลือก ${id}ไม่พบ`}) } diff --git a/cms/static/images/exam_place_holder.png b/cms/static/images/exam_place_holder.png new file mode 100644 index 0000000..8530ffd Binary files /dev/null and b/cms/static/images/exam_place_holder.png differ