From 1b3dc7a6a3140281e3b6e58fc852f54807cbb0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Pruneau?= Date: Mon, 23 Feb 2026 15:57:07 -0500 Subject: [PATCH 1/5] Updated Action script --- .gitea/workflows/node-ci.yaml | 64 ++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/node-ci.yaml b/.gitea/workflows/node-ci.yaml index c49964f..044560d 100644 --- a/.gitea/workflows/node-ci.yaml +++ b/.gitea/workflows/node-ci.yaml @@ -88,6 +88,24 @@ jobs: - name: Run build run: npm run build + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + retention-days: 1 + + - uses: actions/upload-artifact@v3 + with: + name: source + path: src + retention-days: 1 + + - uses: actions/upload-artifact@v3 + with: + name: Dockerfile + path: Dockerfile + retention-days: 1 + - name: Notify Google Chat if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 @@ -96,16 +114,38 @@ jobs: jobStatus: ${{ job.status }} title: Build failed - #- name: deploy - # if: ${{ success() }} - # run: docker build -t targo_frontend . - #deploy: - # needs: [lint, test, build] - # runs-on: ubuntu-24.04 - # if: github.ref == 'refs/heads/main' - # permissions: - # contents: read - # id-token: write - # steps: - # - run: docker build -t targo_frontend . \ No newline at end of file + + deploy: + needs: [lint, test, build] + runs-on: ubuntu-24.04 + if: github.ref == 'refs/heads/main' + permissions: + contents: read + id-token: write + steps: + - name: Getting Dockerfile + uses: actions/download-artifact@v3 + with: + name: Dockerfile + - name: Downloading dist folder + uses: actions/download-artifact@v3 + with: + name: dist + path: dist + - name: Downloading src folder + uses: actions/download-artifact@v3 + with: + name: source + path: source + - name: Set version number + run: echo "VERSION_NUMBER=$(date +'%y%m%d.%H%M%S')" >> $GITHUB_ENV + - name: Building docker image + run: docker build -t git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} . + - name: Add tag Latest + run: docker tag git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} git.targo.ca/targo/targo_frontend_staging:latest + - name: Push images to server + run: | + docker login -u ${{ secrets.CI_USER }} -p ${{ secrets.CI_PASSWORD }} git.targo.ca + docker push git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} + docker push git.targo.ca/targo/targo_frontend_staging:latest \ No newline at end of file From 60550f6364ccbd68e322e64cfb905216d435964b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Pruneau?= Date: Mon, 23 Feb 2026 15:58:06 -0500 Subject: [PATCH 2/5] Updated dockerfile --- Dockerfile | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa43432..c4c69ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,7 @@ -# Step 1 - Building the app -FROM node:22 AS build -WORKDIR /app -COPY package*.json ./ -# Install dependencies -RUN npm install -g @quasar/cli -COPY . . -RUN npm ci -RUN npm run build - -# Step 2 - Move Applicatin to Nginx FROM nginx:alpine -COPY --from=build /app/dist/spa /usr/share/nginx/html RUN mkdir /usr/share/nginx/html/src -COPY --from=build /app/src /usr/share/nginx/html/src - -COPY env.sh /docker-entrypoint.d/env.sh -RUN dos2unix /docker-entrypoint.d/env.sh -RUN chmod +x /docker-entrypoint.d/env.sh - -ENTRYPOINT ["/docker-entrypoint.sh"] - +COPY dist /usr/share/nginx/html +COPY source /usr/share/nginx/html/src +RUN ls -la /usr/share/nginx/html/src EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file From 58db6f7ac45bae1af1e52bbb1500d48fddaa56cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Pruneau?= Date: Mon, 23 Feb 2026 15:59:39 -0500 Subject: [PATCH 3/5] revert 60550f6364ccbd68e322e64cfb905216d435964b revert Updated dockerfile --- Dockerfile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4c69ff..fa43432 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,24 @@ +# Step 1 - Building the app +FROM node:22 AS build +WORKDIR /app +COPY package*.json ./ +# Install dependencies +RUN npm install -g @quasar/cli +COPY . . +RUN npm ci +RUN npm run build + +# Step 2 - Move Applicatin to Nginx FROM nginx:alpine +COPY --from=build /app/dist/spa /usr/share/nginx/html RUN mkdir /usr/share/nginx/html/src -COPY dist /usr/share/nginx/html -COPY source /usr/share/nginx/html/src -RUN ls -la /usr/share/nginx/html/src +COPY --from=build /app/src /usr/share/nginx/html/src + +COPY env.sh /docker-entrypoint.d/env.sh +RUN dos2unix /docker-entrypoint.d/env.sh +RUN chmod +x /docker-entrypoint.d/env.sh + +ENTRYPOINT ["/docker-entrypoint.sh"] + EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file From b353db518c0730f3dadd20acd80ce97de2925e96 Mon Sep 17 00:00:00 2001 From: Frederick Pruneau Date: Tue, 24 Feb 2026 09:13:19 -0500 Subject: [PATCH 4/5] added modifications to build Docker image in Gitea Runners --- .gitea/workflows/node-ci.yaml | 57 ++++++++++++++++++----------------- Dockerfile | 25 +++++---------- 2 files changed, 37 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/node-ci.yaml b/.gitea/workflows/node-ci.yaml index 044560d..c6b45c9 100644 --- a/.gitea/workflows/node-ci.yaml +++ b/.gitea/workflows/node-ci.yaml @@ -36,13 +36,13 @@ jobs: - name: Run linter run: npm run lint - - name: Notify Google Chat - if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps - uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 - with: - webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' - jobStatus: ${{ job.status }} - title: Lint failed +# - name: Notify Google Chat +# if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps +# uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 +# with: +# webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' +# jobStatus: ${{ job.status }} +# title: Lint failed test: runs-on: ubuntu-24.04 @@ -62,13 +62,13 @@ jobs: - name: Run tests run: npm test - - name: Notify Google Chat - if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps - uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 - with: - webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' - jobStatus: ${{ job.status }} - title: Test failed +# - name: Notify Google Chat +# if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps +# uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 +# with: +# webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' +# jobStatus: ${{ job.status }} +# title: Test failed build: runs-on: ubuntu-24.04 @@ -99,27 +99,28 @@ jobs: name: source path: src retention-days: 1 - - uses: actions/upload-artifact@v3 with: name: Dockerfile path: Dockerfile retention-days: 1 - - name: Notify Google Chat - if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps - uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 - with: - webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' - jobStatus: ${{ job.status }} - title: Build failed + # - name: Notify Google Chat + # if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps + # uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 + # with: + # webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' + # jobStatus: ${{ job.status }} + # title: Build failed - + #- name: deploy + # if: ${{ success() }} + # run: docker build -t targo_frontend . deploy: needs: [lint, test, build] runs-on: ubuntu-24.04 - if: github.ref == 'refs/heads/main' + #if: github.ref == 'refs/heads/main' permissions: contents: read id-token: write @@ -141,11 +142,11 @@ jobs: - name: Set version number run: echo "VERSION_NUMBER=$(date +'%y%m%d.%H%M%S')" >> $GITHUB_ENV - name: Building docker image - run: docker build -t git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} . + run: docker build -t git.targo.ca/targo/targo-frontend-staging:2.${{ env.VERSION_NUMBER }} . - name: Add tag Latest - run: docker tag git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} git.targo.ca/targo/targo_frontend_staging:latest + run: docker tag git.targo.ca/targo/targo-frontend-staging:2.${{ env.VERSION_NUMBER }} git.targo.ca/targo/targo-frontend-staging:latest - name: Push images to server run: | docker login -u ${{ secrets.CI_USER }} -p ${{ secrets.CI_PASSWORD }} git.targo.ca - docker push git.targo.ca/targo/targo_frontend_staging:2.${{ env.VERSION_NUMBER }} - docker push git.targo.ca/targo/targo_frontend_staging:latest \ No newline at end of file + docker push git.targo.ca/targo/targo-frontend-staging:2.${{ env.VERSION_NUMBER }} + docker push git.targo.ca/targo/targo-frontend-staging:latest diff --git a/Dockerfile b/Dockerfile index fa43432..73f79ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,15 @@ -# Step 1 - Building the app -FROM node:22 AS build -WORKDIR /app -COPY package*.json ./ -# Install dependencies -RUN npm install -g @quasar/cli -COPY . . -RUN npm ci -RUN npm run build - -# Step 2 - Move Applicatin to Nginx FROM nginx:alpine -COPY --from=build /app/dist/spa /usr/share/nginx/html -RUN mkdir /usr/share/nginx/html/src -COPY --from=build /app/src /usr/share/nginx/html/src -COPY env.sh /docker-entrypoint.d/env.sh +#Copy files +RUN mkdir /usr/share/nginx/html/src +COPY dist/spa /usr/share/nginx/html +COPY source /usr/share/nginx/html/src + +#Add script to replace VITE env vars +RUN curl -o /docker-entrypoint.d/env.sh -O https://raw.githubusercontent.com/Dutchskull/Vite-Dynamic-Environment-Variables/refs/heads/main/app/env.sh RUN dos2unix /docker-entrypoint.d/env.sh RUN chmod +x /docker-entrypoint.d/env.sh ENTRYPOINT ["/docker-entrypoint.sh"] - EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] From 2895284bc1c47e0bd82a2608da132aaa2506e696 Mon Sep 17 00:00:00 2001 From: Frederick Pruneau Date: Tue, 24 Feb 2026 09:55:11 -0500 Subject: [PATCH 5/5] modification in action script --- .gitea/workflows/node-ci.yaml | 45 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/node-ci.yaml b/.gitea/workflows/node-ci.yaml index c6b45c9..dc984a2 100644 --- a/.gitea/workflows/node-ci.yaml +++ b/.gitea/workflows/node-ci.yaml @@ -36,13 +36,13 @@ jobs: - name: Run linter run: npm run lint -# - name: Notify Google Chat -# if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps -# uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 -# with: -# webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' -# jobStatus: ${{ job.status }} -# title: Lint failed + - name: Notify Google Chat + if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps + uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 + with: + webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' + jobStatus: ${{ job.status }} + title: Lint failed test: runs-on: ubuntu-24.04 @@ -62,13 +62,13 @@ jobs: - name: Run tests run: npm test -# - name: Notify Google Chat -# if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps -# uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 -# with: -# webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' -# jobStatus: ${{ job.status }} -# title: Test failed + - name: Notify Google Chat + if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps + uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 + with: + webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' + jobStatus: ${{ job.status }} + title: Test failed build: runs-on: ubuntu-24.04 @@ -105,17 +105,14 @@ jobs: path: Dockerfile retention-days: 1 - # - name: Notify Google Chat - # if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps - # uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 - # with: - # webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' - # jobStatus: ${{ job.status }} - # title: Build failed + - name: Notify Google Chat + if: ${{ failure() }} # Use always to ensure that the notification is also send on failure of former steps + uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 + with: + webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' + jobStatus: ${{ job.status }} + title: Build failed - #- name: deploy - # if: ${{ success() }} - # run: docker build -t targo_frontend . deploy: needs: [lint, test, build]