clean code and fix date display bug
This commit is contained in:
parent
9012d03515
commit
e5a3f1793f
4 changed files with 4 additions and 79 deletions
23
.github/workflows/deploy.yaml
vendored
23
.github/workflows/deploy.yaml
vendored
|
|
@ -1,23 +0,0 @@
|
|||
name: deploy-docker
|
||||
run-name: deploy-docker ${{ github.actor }}
|
||||
on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
# https://github.com/appleboy/ssh-action
|
||||
# act -W .github/workflows/deploy.yaml -j remote-deploy -s SSH_PASSWORD
|
||||
remote-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Remote Deployment
|
||||
uses: appleboy/ssh-action@v0.1.8
|
||||
with:
|
||||
host: frappet.com
|
||||
username: frappet
|
||||
password: ${{ secrets.SSH_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /home/frappet/docker/bma-ehr-recruit-qualifying-exam
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
touch success
|
||||
|
||||
55
.github/workflows/remote-build.yaml
vendored
55
.github/workflows/remote-build.yaml
vendored
|
|
@ -1,55 +0,0 @@
|
|||
name: remote-build
|
||||
run-name: remote-build ${{ github.actor }}
|
||||
on:
|
||||
# push:
|
||||
# tags:
|
||||
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
# tags-ignore:
|
||||
# - '2.*'
|
||||
# Allow run workflow manually from Action tab
|
||||
workflow_dispatch:
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
CMS_IMAGE_NAME: demo/qualifying-exam-cms
|
||||
CMS_IMAGE_TAG: 0.2.1
|
||||
jobs:
|
||||
# act --workflows .github/workflows/build.yaml --job remote-image -s DOCKER_USER -s DOCKER_PASS -s SSH_PASSWORD
|
||||
# act -W .github/workflows/remote-build.yaml -j remote-image -s DOCKER_USER -s DOCKER_PASS -s SSH_PASSWORD
|
||||
remote-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Login in to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{env.REGISTRY}}
|
||||
username: ${{secrets.DOCKER_USER}}
|
||||
password: ${{secrets.DOCKER_PASS}}
|
||||
# Node no need because use 2 state build
|
||||
# - uses: actions/setup-node@v3
|
||||
# with:
|
||||
# node-version: '18'
|
||||
- name: Build and push docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: cms
|
||||
# platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:${{env.CMS_IMAGE_TAG}},${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:latest
|
||||
- name: Remote Deployment
|
||||
uses: appleboy/ssh-action@v0.1.8
|
||||
with:
|
||||
host: frappet.com
|
||||
username: frappet
|
||||
password: ${{ secrets.SSH_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /home/frappet/docker/bma-ehr-recruit-qualifying-exam
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
touch success
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//import type {Exam} 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+""
|
||||
|
|
@ -11,6 +11,7 @@ export const load: PageServerLoad = async ({params,fetch}) => {
|
|||
throw error(500,{message:`พบข้อผิดพลาดเกี่ยวกับข้อมูลสอบคัดเลือก ${id}`})
|
||||
}
|
||||
const post = await res.json()
|
||||
post.date= post.start? dayjs(post.start).format("DD MMM BBBB"):""
|
||||
return post
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
//import type {Exam} 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+""
|
||||
|
|
@ -11,6 +12,7 @@ export const load: PageServerLoad = async ({params,fetch}) => {
|
|||
throw error(500,{message:`พบข้อผิดพลาดเกี่ยวกับข้อมูลสอบคัดเลือก ${id}`})
|
||||
}
|
||||
const post = await res.json()
|
||||
post.date= post.start? dayjs(post.start).format("DD MMM BBBB"):""
|
||||
return post
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue