mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-22 08:54:33 +03:00
Updated to node 18 and fixed replace-version script for vite structure
This commit is contained in:
parent
1d1c8153e7
commit
595b3c0450
6 changed files with 10 additions and 10 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
|||
ci:
|
||||
uses: shlinkio/github-actions/.github/workflows/web-app-ci.yml@main
|
||||
with:
|
||||
node-version: 16.15
|
||||
node-version: 18.12
|
||||
with-mutation-tests: true
|
||||
publish-coverage: true
|
||||
force-install: true
|
||||
|
|
2
.github/workflows/deploy-preview.yml
vendored
2
.github/workflows/deploy-preview.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
- name: Use node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.15
|
||||
node-version: 18.12
|
||||
- name: Build
|
||||
run: |
|
||||
npm ci --force && \
|
||||
|
|
2
.github/workflows/publish-release.yml
vendored
2
.github/workflows/publish-release.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
|||
- name: Use node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.15
|
||||
node-version: 18.12
|
||||
- name: Generate release assets
|
||||
run: npm ci --force && VERSION=${GITHUB_REF#refs/tags/v} npm run build:dist
|
||||
- name: Publish release with assets
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
FROM node:16.15-alpine as node
|
||||
FROM node:18.12-alpine as node
|
||||
COPY . /shlink-web-client
|
||||
ARG VERSION="latest"
|
||||
ENV VERSION ${VERSION}
|
||||
RUN cd /shlink-web-client && npm ci --force && NODE_ENV=production npm run build
|
||||
RUN cd /shlink-web-client && npm ci --force && npm run build
|
||||
|
||||
FROM nginx:1.21-alpine
|
||||
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
||||
|
|
|
@ -3,8 +3,8 @@ version: '3'
|
|||
services:
|
||||
shlink_web_client_node:
|
||||
container_name: shlink_web_client_node
|
||||
image: node:16.15-alpine
|
||||
command: /bin/sh -c "cd /home/shlink/www && npm install && npm run start"
|
||||
image: node:18.12-alpine
|
||||
command: /bin/sh -c "cd /home/shlink/www && npm install --force && npm run start"
|
||||
volumes:
|
||||
- ./:/home/shlink/www
|
||||
ports:
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import fs from 'fs';
|
||||
|
||||
function replaceVersionPlaceholder(version) {
|
||||
const staticJsFilesPath = './build/static/js';
|
||||
const staticJsFilesPath = './build/assets';
|
||||
const versionPlaceholder = '%_VERSION_%';
|
||||
|
||||
const isMainFile = (file) => file.startsWith('main.') && file.endsWith('.js');
|
||||
const [ mainJsFile ] = fs.readdirSync(staticJsFilesPath).filter(isMainFile);
|
||||
const isMainFile = (file) => file.startsWith('index-') && file.endsWith('.js');
|
||||
const [mainJsFile] = fs.readdirSync(staticJsFilesPath).filter(isMainFile);
|
||||
const filePath = `${staticJsFilesPath}/${mainJsFile}`;
|
||||
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
||||
const replaced = fileContent.replace(versionPlaceholder, version);
|
||||
|
|
Loading…
Reference in a new issue