diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d112c6f..2dc6b4e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 76b02a48..019913fe 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -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 && \ diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 52d82e65..554783a1 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index c6ce8170..06636e83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " diff --git a/docker-compose.yml b/docker-compose.yml index 3c8589a3..16a1bbba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/scripts/replace-version.mjs b/scripts/replace-version.mjs index 38e49682..a70ddb0a 100644 --- a/scripts/replace-version.mjs +++ b/scripts/replace-version.mjs @@ -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);