Compare commits

1 Commits

Author SHA1 Message Date
f7dd929bdd CI 1 2022-04-20 10:34:38 +02:00
4 changed files with 14 additions and 42 deletions

View File

@@ -7,21 +7,19 @@ stages:
cache: cache:
key: ${CI_COMMIT_REF_SLUG} key: ${CI_COMMIT_REF_SLUG}
paths: paths:
- frontend/node_modules - node_modules
build:blobs: build:blobs:
image: golang:1.17 image: golang:1.17
stage: build stage: build
script: script:
- mkdir blobs/ - mkdir /blobs
- make wasm - make wasm
- make build-cross-clis - make build-cross-clis
- mv covergen.wasm dist blobs/ - 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: artifacts:
paths: paths:
- blobs/ - /blobs
expire_in: 30 days expire_in: 30 days
build:frontend: build:frontend:
@@ -30,14 +28,14 @@ build:frontend:
needs: needs:
- build:blobs - build:blobs
before_script: before_script:
- cd frontend/
- corepack npm install --immutable - corepack npm install --immutable
script: script:
- mv ../blobs/* public - cd frontend
- mv /blobs/* public
- corepack npm run build - corepack npm run build
artifacts: artifacts:
paths: paths:
- frontend/dist/ - dist/
expire_in: 30 days expire_in: 30 days
deploy: deploy:
@@ -48,8 +46,7 @@ deploy:
before_script: before_script:
- apk add lftp - apk add lftp
script: script:
- cd frontend/ - lftp "$DEPLOY_USER_PASS@vps0.miwebb.com:/" -e "mirror -R dist/ .; quit"
- lftp "$DEPLOY_USER_PASS@vps17.miwebb.com:/" -e "mirror -R dist/ .; quit"
environment: environment:
name: live name: live
url: https://covergen.miwebb.dev url: https://covergen.miwebb.dev

View File

@@ -1,9 +0,0 @@
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>

View File

@@ -21,17 +21,6 @@ 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);
@@ -52,11 +41,6 @@ function doRender() {
} }
} }
} }
function onClick() {
label.update();
doRender();
}
</script> </script>
<template> <template>
@@ -78,9 +62,9 @@ function onClick() {
<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="onClick" @click="label.update() && doRender()"
> >
{{ label.label.value }} {{ label.label.value }}
</button> </button>
</div> </div>
</template> </template>

View File

@@ -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({ export default defineConfig(({ mode }) => ({
plugins: [vue()], plugins: [vue()],
base: '/', base: mode === 'production' ? '/covergen/' : '/',
resolve: { resolve: {
alias: { alias: {
'@': resolve(__dirname, './src'), '@': resolve(__dirname, './src'),
}, },
}, },
}); }));