diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28ebc8bb..bcdfa7ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,11 +132,11 @@ jobs: - name: Build env: - DEMO: true NODE_ENV: production + PR_NUMBER: ${{ github.event.number }} run: | npm run generate-dictionary - npx webpack --config webpack.config.prod.js + npm run build - name: Publish to Cloudflare Pages id: deploy diff --git a/build-manifest.js b/build-manifest.js new file mode 100644 index 00000000..4d111d58 --- /dev/null +++ b/build-manifest.js @@ -0,0 +1,8 @@ +const fs = require('fs'); +const manifest = require('./src/manifest.json'); + +if (process.env.PR_NUMBER && process.env.PR_NUMBER.length) { + manifest.name = manifest.short_name =`Test ${process.env.PR_NUMBER}` +} + +fs.writeFileSync('./dist/manifest.json', JSON.stringify(manifest)); diff --git a/package.json b/package.json index d08fd74d..8c04c04a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "main": "./dist/worker.js", "scripts": { - "build": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js", + "build": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js && node build-manifest.js", "build-storybook": "storybook build", "deploy-api": "wrangler deploy ./src/server/index.ts --name api --compatibility-date 2024-11-12", "dev": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress", diff --git a/src/components/Pages/About/About.tsx b/src/components/Pages/About/About.tsx index d353330d..f57d2ff2 100644 --- a/src/components/Pages/About/About.tsx +++ b/src/components/Pages/About/About.tsx @@ -14,6 +14,7 @@ export const About = const worksheetUrl = getTablePublicUrl(tablesData[0].spreadsheetId, tablesData[0].sheetId); const email = 'cherebedov.sergey@gmail.com'; const source = 'http://steen.free.fr/interslavic'; + const version = [VERSION, PR_NUMBER].filter((item) => item && item.length).join('-') return (