mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
add docker container
This commit is contained in:
34
.github/workflows/bun.yml
vendored
34
.github/workflows/bun.yml
vendored
@@ -7,6 +7,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKERHUB_SLUG: megghy/vtsuru_live
|
||||||
|
GHCR_SLUG: ghcr.io/megghy/vtsuru_live
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
@@ -24,3 +28,33 @@ jobs:
|
|||||||
run: bun run build
|
run: bun run build
|
||||||
- name: 📦 Upload SourceMap
|
- name: 📦 Upload SourceMap
|
||||||
run: bunx @hyperdx/cli upload-sourcemaps --serviceKey ${{ secrets.HYPERDX_SERVICE_KEY }} --path dist/assets
|
run: bunx @hyperdx/cli upload-sourcemaps --serviceKey ${{ secrets.HYPERDX_SERVICE_KEY }} --path dist/assets
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.DOCKERHUB_SLUG }}
|
||||||
|
${{ env.GHCR_SLUG }}
|
||||||
|
|
||||||
|
- name: Get current time
|
||||||
|
uses: josStorer/get-current-time@v2
|
||||||
|
id: time
|
||||||
|
with:
|
||||||
|
format: YYYYMMDD_HHmmss
|
||||||
|
utcOffset: "+08:00"
|
||||||
|
|
||||||
|
- name: Build Docker image and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.GHCR_SLUG }}:latest
|
||||||
|
${{ env.GHCR_SLUG }}:${{ steps.time.outputs.formattedTime }}
|
||||||
|
|||||||
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM caddy:alpine
|
||||||
|
|
||||||
|
COPY dist/ /etc/caddy/html/
|
||||||
|
COPY src/files/Caddyfile /etc/caddy/
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
11
src/files/Caddyfile
Normal file
11
src/files/Caddyfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
:80 {
|
||||||
|
# Compress responses according to Accept-Encoding headers
|
||||||
|
encode gzip zstd
|
||||||
|
|
||||||
|
root * /etc/caddy/html/
|
||||||
|
|
||||||
|
try_files {path} /index.html
|
||||||
|
|
||||||
|
# Serve everything else from the file system
|
||||||
|
file_server
|
||||||
|
}
|
||||||
@@ -49,6 +49,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: 'goods',
|
path: 'goods',
|
||||||
name: 'user-goods',
|
name: 'user-goods',
|
||||||
|
alias: 'point',
|
||||||
component: () => import('@/views/pointViews/PointGoodsView.vue'),
|
component: () => import('@/views/pointViews/PointGoodsView.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '积分兑换',
|
title: '积分兑换',
|
||||||
|
|||||||
@@ -386,8 +386,8 @@ onMounted(() => { })
|
|||||||
</NDivider>
|
</NDivider>
|
||||||
<NFlex align="center">
|
<NFlex align="center">
|
||||||
<NInputGroup style="max-width: 400px;">
|
<NInputGroup style="max-width: 400px;">
|
||||||
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`" readonly />
|
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/goods`" readonly />
|
||||||
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`)">
|
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/goods`)">
|
||||||
复制 </NButton>
|
复制 </NButton>
|
||||||
</NInputGroup>
|
</NInputGroup>
|
||||||
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
|
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
|
||||||
|
|||||||
Reference in New Issue
Block a user