Moved to Forgejo infrastructure
All checks were successful
Production Build and Deploy / Build (push) Successful in 1m11s
Production Build and Deploy / Deploy (push) Successful in 7s

This commit is contained in:
Liviu Burcusel 2025-12-05 16:52:09 +01:00
parent b5b082bc5d
commit 30a89d6662
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
14 changed files with 1455 additions and 861 deletions

View file

@ -0,0 +1,107 @@
name: Production Build and Deploy
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- production
pull_request:
branches:
- production
types: [opened, synchronize, reopened]
env:
FORGEJO_HOST: git.burcusel.nl
CONTAINER_NAME: glowing-fiesta
OWNER: public
jobs:
build:
name: Build
runs-on: node24
steps:
- name: Setup Node environment
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Code checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: npm ci
- name: Run tests and generate coverage
run: npm run coverage
# continue-on-error: true
# env:
# CI: true
- name: SonarQube Scan
uses: https://github.com/SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Build site
env:
NITRO_PRESET: node_cluster
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: output
path: .output/
overwrite: true
include-hidden-files: true
deploy:
name: Deploy
needs: build
runs-on: docker
steps:
- name: Setup Node environment
run: |
apk add --update nodejs npm
- name: Code checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare environment variables
id: prepare-env
run: |
echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV
echo CONTAINER_NAME=${{ env.CONTAINER_NAME }} >> $GITHUB_ENV
echo VERSION=$(node -p "require('./package.json').version")
echo VERSION=$(node -p "require('./package.json').version") >> "$GITHUB_OUTPUT"
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: output
path: ./output
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PACKAGING_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: context
# push: true
# provenance: false
# tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest
# - name: check docker
# run: |
# docker --version
# docker info
- name: Build Docker image and push
run: |
echo [${{ env.CONTAINER_NAME }}:"${{ steps.prepare-env.outputs.VERSION }}", ${{ env.CONTAINER_NAME }}:latest]
docker build -f ./devops/Dockerfile -t ${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }} -t ${{ env.CONTAINER_NAME }}:latest .
docker image tag ${{ env.CONTAINER_NAME }}:latest ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:latest
docker image push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:latest
docker image tag ${{ env.CONTAINER_NAME }}:latest ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }}
docker image push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }}
- name: Server deploy
run: |
echo "Deploy to server not implemented yet."
####

View file

@ -1,36 +0,0 @@
name: Sonar
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- production
pull_request:
branches:
- production
types: [opened, synchronize, reopened]
jobs:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node environment
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests and generate coverage
run: npm run coverage
continue-on-error: true
env:
CI: true
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View file

@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 282 282" width="282" height="282">
<style>
circle,
path{fill:none;stroke:#000;stroke-width:15}
path{stroke-width:25}
.white{stroke:#ccc}
.red{stroke:#AD1D25}
.blue{stroke:#1E4785}
</style>
<g transform="translate(50 6)">
<path d="M58 168V70a50 50 0 0 1 50-50h20" class="red"/>
<path d="M58 236v-100a50 50 0 0 1 50-50h20" class="white"/>
<path d="M58 236v-30a50 50 0 0 1 50-50h20" class="blue"/>
<circle cx="142" cy="20" r="18" class="red"/>
<circle cx="142" cy="88" r="18" class="white"/>
<circle cx="142" cy="156" r="18" class="blue"/>
<circle cx="58" cy="250" r="18" class="blue"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 709 B

View file

@ -21,7 +21,7 @@ const toggleMenu = () => {
</button>
<nuxt-link to="/" class="layout-topbar-logo">
<img src="@/assets/images/logo.png" alt="Two stick silhouettes admiring fireworks in the sky" />
<img src="@/assets/images/logo.svg" alt="Git like tree using red, white-ish and blue colours." />
<span>Glowing Fiesta</span>
</nuxt-link>
</div>

14
devops/Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM node:lts-alpine
ENV NITRO_CLUSTER_WORKERS=4
WORKDIR /app
COPY output ./
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "/app/server/index.mjs"]

2122
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
{
"name": "glowing-fiesta",
"version": "1.0.0",
"type": "module",
"private": true,
"scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Before After
Before After

View file

@ -1,5 +1,6 @@
sonar.projectKey=lburcusel_glowing-fiesta
sonar.organization=lburcusel
# sonar.projectKey=lburcusel_glowing-fiesta
# sonar.organization=lburcusel
sonar.projectKey=GF
sonar.projectName=Glowing Fiesta
sonar.projectVersion=1.0.0

View file

@ -26,7 +26,7 @@ describe("Topbar.vue", () => {
it("renders the logo image and text", () => {
const logo = wrapper.find(".layout-topbar-logo");
expect(logo.exists()).toBe(true);
expect(logo.find("img").attributes("alt")).toBe("Two stick silhouettes admiring fireworks in the sky");
expect(logo.find("img").attributes("alt")).toBe("Git like tree using red, white-ish and blue colours.");
expect(logo.text()).toContain("Glowing Fiesta");
});
@ -81,12 +81,16 @@ describe("Topbar.vue", () => {
it("updates isDarkTheme ref when toggled", async () => {
const darkModeButton = wrapper.find(".layout-topbar-action-highlight");
// @ts-expect-error: it's a test accessing vm property
expect(wrapper.vm.isDarkTheme).toBe(false);
await darkModeButton.trigger("click");
// @ts-expect-error: it's a test accessing vm property
expect(wrapper.vm.isDarkTheme).toBe(true);
await darkModeButton.trigger("click");
// @ts-expect-error: it's a test accessing vm property
expect(wrapper.vm.isDarkTheme).toBe(false);
});
});
@ -123,7 +127,7 @@ describe("Topbar.vue", () => {
it("has correct image source", () => {
const img = wrapper.find(".layout-topbar-logo img");
expect(img.attributes("src")).toContain("logo.png");
expect(img.attributes("src")).toContain("data:image/svg+xml");
});
});