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] 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