From a1b60ba2beea1cabdd78d5c4c99bed86590eff8f Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Mon, 1 Apr 2024 18:02:49 +0200 Subject: [PATCH 1/5] added dev deploy --- .forgejo/workflows/build-deploy.yml | 21 ++++++++++++++++++++- package.json | 5 +++-- src/_data/global.dev.json | 17 +++++++++++++++++ src/_data/site.js | 7 ++++++- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src/_data/global.dev.json diff --git a/.forgejo/workflows/build-deploy.yml b/.forgejo/workflows/build-deploy.yml index adae29d..0bc9881 100644 --- a/.forgejo/workflows/build-deploy.yml +++ b/.forgejo/workflows/build-deploy.yml @@ -3,11 +3,30 @@ name: Build and Deploy Website on: [push] jobs: + build-dev: + name: Build Dev Website + runs-on: docker + container: + image: node:lts + if: github.ref != 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: npm install + - name: Build English Version + run: npm run build:dev + - name: Build German Version + run: npm run build:dev:de + - uses: actions/upload-artifact@v3 + with: + name: build + path: dist/ build: name: Build Website runs-on: docker container: image: node:lts + if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Install Dependencies @@ -25,7 +44,7 @@ jobs: runs-on: docker container: image: node:lts-alpine - needs: [build] + needs: [build-dev] if: github.ref == 'refs/heads/develop' steps: - uses: actions/download-artifact@v3 diff --git a/package.json b/package.json index c98e439..3fc19d9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "start": "eleventy --serve --watch", "start:de": "LANGUAGE=de eleventy --serve --watch", "build": "eleventy && npm run minify-css", - "build:de": "LANGUAGE=de eleventy && npm run minify-css" + "build:de": "LANGUAGE=de eleventy && npm run minify-css", + "build:dev": "BUILD=dev eleventy && npm run minify-css", + "build:dev:de": "BUILD=dev LANGUAGE=de eleventy && npm run minify-css" }, "author": "samuel-p", "repository": { @@ -25,7 +27,6 @@ "@node-minify/crass": "^8.0.6", "@node-minify/html-minifier": "^8.0.6", "@sardine/eleventy-plugin-tinyhtml": "^0.2.0", - "cpx": "^1.5.0", "eleventy-plugin-rev": "^2.0.0", "eleventy-sass": "^2.2.4", "glob": "^10.3.12", diff --git a/src/_data/global.dev.json b/src/_data/global.dev.json new file mode 100644 index 0000000..cdaf3e7 --- /dev/null +++ b/src/_data/global.dev.json @@ -0,0 +1,17 @@ +{ + "title": "DEV Samuel Philipp", + "languages": [ + { + "label": "English", + "code": "en", + "icon": "us", + "url": "https://dev.samuel-philipp.com" + }, + { + "label": "Deutsch", + "code": "de", + "icon": "de", + "url": "https://dev.samuel-philipp.de" + } + ] +} diff --git a/src/_data/site.js b/src/_data/site.js index b22ee0f..73458ad 100644 --- a/src/_data/site.js +++ b/src/_data/site.js @@ -1,6 +1,11 @@ +const fs = require("fs"); const site = require("./global.json"); -site.buildTime = new Date(); +site.buildName = process.env.BUILD || 'prod'; +if (fs.existsSync(`${__dirname}/global.${site.buildName}.json`)) { + Object.assign(site, require(`./global.${site.buildName}.json`)); +} +site.buildTime = new Date().toISOString(); site.lang = process.env.LANGUAGE || 'en'; site.language = site.languages.find(l => l.code === site.lang); site.strings = require(`./i18n/${site.lang}.json`); -- 2.45.2 From bd4dc1c9e6807497140c58673e2d650d21df2eb6 Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Mon, 1 Apr 2024 18:16:49 +0200 Subject: [PATCH 2/5] updated dev --- src/_data/global.dev.json | 1 - src/index.html | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/_data/global.dev.json b/src/_data/global.dev.json index cdaf3e7..1e333fe 100644 --- a/src/_data/global.dev.json +++ b/src/_data/global.dev.json @@ -1,5 +1,4 @@ { - "title": "DEV Samuel Philipp", "languages": [ { "label": "English", diff --git a/src/index.html b/src/index.html index 42a5ed3..dacbbad 100644 --- a/src/index.html +++ b/src/index.html @@ -79,10 +79,10 @@ title: {{site.title}} class="i-stackoverflow i-2x i-fw">
-- 2.45.2 From 9855fa8aa7c60b5f3b60b7ab435733022095ef5b Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Mon, 1 Apr 2024 18:19:58 +0200 Subject: [PATCH 3/5] updated dev --- src/_data/global.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_data/global.json b/src/_data/global.json index efbd6eb..99af261 100644 --- a/src/_data/global.json +++ b/src/_data/global.json @@ -4,17 +4,17 @@ "description": "Samuel Philipp - Full-Stack Developer / SysAdmin / Magician", "author": "Samuel Philipp", "languages": [ - { - "label": "English", - "code": "en", - "icon": "us", - "url": "https://samuel-philipp.com" - }, { "label": "Deutsch", "code": "de", "icon": "de", "url": "https://samuel-philipp.de" + }, + { + "label": "English", + "code": "en", + "icon": "us", + "url": "https://samuel-philipp.com" } ], "menu": { -- 2.45.2 From 33c4b313a2155e0a40e9f36f4b8e1effe154b6c4 Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Mon, 1 Apr 2024 20:20:50 +0200 Subject: [PATCH 4/5] updated dev --- src/_data/global.dev.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_data/global.dev.json b/src/_data/global.dev.json index 1e333fe..beb27b8 100644 --- a/src/_data/global.dev.json +++ b/src/_data/global.dev.json @@ -1,16 +1,16 @@ { "languages": [ - { - "label": "English", - "code": "en", - "icon": "us", - "url": "https://dev.samuel-philipp.com" - }, { "label": "Deutsch", "code": "de", "icon": "de", "url": "https://dev.samuel-philipp.de" + }, + { + "label": "English", + "code": "en", + "icon": "us", + "url": "https://dev.samuel-philipp.com" } ] } -- 2.45.2 From 508fcbca9f0979555457f1261cc9bb7c63b974ab Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Mon, 1 Apr 2024 21:16:10 +0200 Subject: [PATCH 5/5] updated README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index f9288e5..8ad18cd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://ci.sp-codes.de/api/badges/samuel-p/samuel-philipp.de/status.svg)](https://ci.sp-codes.de/samuel-p/samuel-philipp.de) - # samuel-philipp.de Website for [samuel-philipp.de](https://samuel-philipp.de) and [samuel-philipp.com](https://samuel-philipp.com) -- 2.45.2