Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f59ad2320 | |||
| 83d38ef427 | |||
| e4cc2c31ec | |||
| fdc9b1a82f |
55
.gitlab-ci.yml
Normal file
55
.gitlab-ci.yml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
# cache using branch name
|
||||||
|
# https://gitlab.com/help/ci/caching/index.md
|
||||||
|
cache:
|
||||||
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
|
paths:
|
||||||
|
- frontend/node_modules
|
||||||
|
|
||||||
|
build:blobs:
|
||||||
|
image: golang:1.17
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- mkdir blobs/
|
||||||
|
- make wasm
|
||||||
|
- make build-cross-clis
|
||||||
|
- mv covergen.wasm dist blobs/
|
||||||
|
# Grab the wasm shim from the docker image
|
||||||
|
- cp /usr/local/go/misc/wasm/wasm_exec.js blobs/wasm_exec.js
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- blobs/
|
||||||
|
expire_in: 30 days
|
||||||
|
|
||||||
|
build:frontend:
|
||||||
|
image: node:16
|
||||||
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build:blobs
|
||||||
|
before_script:
|
||||||
|
- cd frontend/
|
||||||
|
- corepack npm install --immutable
|
||||||
|
script:
|
||||||
|
- mv ../blobs/* public
|
||||||
|
- corepack npm run build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- frontend/dist/
|
||||||
|
expire_in: 30 days
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
stage: deploy
|
||||||
|
image: alpine
|
||||||
|
needs:
|
||||||
|
- build:frontend
|
||||||
|
before_script:
|
||||||
|
- apk add lftp
|
||||||
|
script:
|
||||||
|
- cd frontend/
|
||||||
|
- lftp "$DEPLOY_USER_PASS@vps17.miwebb.com:/" -e "mirror -R dist/ .; quit"
|
||||||
|
environment:
|
||||||
|
name: live
|
||||||
|
url: https://covergen.miwebb.dev
|
||||||
9
frontend/public/.htaccess
Normal file
9
frontend/public/.htaccess
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
AddType application/wasm .wasm
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule (.*) /index.html [QSA,L]
|
||||||
|
</IfModule>
|
||||||
@@ -21,6 +21,17 @@ const possibleLabels = [
|
|||||||
'Rosebud',
|
'Rosebud',
|
||||||
'You show that customer',
|
'You show that customer',
|
||||||
'Do it for Berend',
|
'Do it for Berend',
|
||||||
|
'To the bad cave!',
|
||||||
|
'The more you earn, the more you learn',
|
||||||
|
'Fortune sides with him who dares',
|
||||||
|
'Up, Up, Down, Down, Left, Right, Left, Right, B, A.',
|
||||||
|
'Show me the money',
|
||||||
|
'Something for nothing',
|
||||||
|
'There is no cow level',
|
||||||
|
'WhatIsBestInLife',
|
||||||
|
'RealMenDrillDeep',
|
||||||
|
'WhySoSerious',
|
||||||
|
'IAmIronMan',
|
||||||
];
|
];
|
||||||
const label = randomLabel(possibleLabels);
|
const label = randomLabel(possibleLabels);
|
||||||
|
|
||||||
@@ -41,6 +52,11 @@ function doRender() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onClick() {
|
||||||
|
label.update();
|
||||||
|
doRender();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -62,9 +78,9 @@ function doRender() {
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="px-4 py-2 bg-blue-500 rounded-lg hover:bg-blue-600 text-white border-2 active:border-blue-500 focus:outline focus:outline-2 focus:outline-blue-500"
|
class="px-4 py-2 bg-blue-500 rounded-lg hover:bg-blue-600 text-white border-2 active:border-blue-500 focus:outline focus:outline-2 focus:outline-blue-500"
|
||||||
@click="label.update() && doRender()"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
{{ label.label.value }}
|
{{ label.label.value }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import vue from '@vitejs/plugin-vue';
|
|||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => ({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
base: mode === 'production' ? '/covergen/' : '/',
|
base: '/',
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve(__dirname, './src'),
|
'@': resolve(__dirname, './src'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user