From 3c14288787327a02bf718df41dfd3d67529148b6 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Sun, 5 Jul 2026 21:18:37 +0200 Subject: [PATCH] Add docker build --- .github/workflows/ci.yml | 2 ++ .github/workflows/test.yml | 19 ---------------- .gitlab-ci.yml | 42 +++++++++++++++++++++++++++++++++++ .tool-versions | 1 + actions/gls-action/Dockerfile | 2 +- 5 files changed, 46 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/test.yml create mode 100644 .tool-versions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab7f79e..5129c6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: permissions: pull-requests: write + packages: write jobs: pipeline: @@ -26,6 +27,7 @@ jobs: OVERRIDE_GITHUB_REF_NAME: ${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.head.ref }} env: GLPA_C0_GH_REF: ${{ github.ref }} + GLPA_C0_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Find existing comment uses: peter-evans/find-comment@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 1412b91..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Run Tests -on: - push: - branches: - - 'main' - pull_request: -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v6 - with: - node-version: '24.10.0' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - - run: npm run typecheck - - run: npm run build - - run: npm run test \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0933d5b..6155523 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,49 @@ stages: - test + - build include: - project: code0-tech/development/telescopium ref: build-branch file: ci-template.gitlab-ci.yml + +.dind: + variables: + DOCKER_MIRROR: https://mirror.gcr.io + DOCKER_OPTIONS: "--registry-mirror ${DOCKER_MIRROR}" + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://docker:2376 + DOCKER_TLS_CERTDIR: /certs + services: + - name: docker:29.4.1-dind + alias: docker + entrypoint: [ "sh", "-c", "dockerd-entrypoint.sh $DOCKER_OPTIONS" ] + +.node-actions: + - gls-action + +test-node: + image: node:24.10.0 + stage: test + parallel: + matrix: + - C0_ACTION: !reference [.node-actions] + script: + - cd actions/$C0_ACTION + - npm ci + - npm run typecheck + - npm run test + +build-docker: + extends: + - .dind + image: docker:29.4.1 + stage: build + parallel: + matrix: + - C0_ACTION: !reference [.node-actions] + script: + - cd actions/$C0_ACTION + - echo $C0_GH_TOKEN | docker login -u $ --password-stdin ghcr.io + - docker build -t ghcr.io/code0-tech/centaurus/ci-builds/$C0_ACTION:0.0.0-experimental-$CI_PIPELINE_ID-$CI_COMMIT_SHA . + - docker push ghcr.io/code0-tech/centaurus/ci-builds/$C0_ACTION:0.0.0-experimental-$CI_PIPELINE_ID-$CI_COMMIT_SHA diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..45f1ca6 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 24.10.0 diff --git a/actions/gls-action/Dockerfile b/actions/gls-action/Dockerfile index cbca323..5871953 100644 --- a/actions/gls-action/Dockerfile +++ b/actions/gls-action/Dockerfile @@ -1,4 +1,4 @@ -FROM node:24-alpine +FROM node:24.10.0-alpine WORKDIR /app