From 46a5024107f1570bc4a8200a28bf00355ede89a7 Mon Sep 17 00:00:00 2001 From: Pierre Geeraert Date: Mon, 19 Jan 2026 15:03:45 +0000 Subject: [PATCH] preparing everything --- .gitea/workflows/dockerfile_runner.yaml | 81 +++++++++++++++++++++++++ Dockerfile | 3 + 2 files changed, 84 insertions(+) create mode 100644 .gitea/workflows/dockerfile_runner.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/dockerfile_runner.yaml b/.gitea/workflows/dockerfile_runner.yaml new file mode 100644 index 0000000..ca35666 --- /dev/null +++ b/.gitea/workflows/dockerfile_runner.yaml @@ -0,0 +1,81 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: + push: + issue_comment: + types: [created] + +jobs: + Explore-Gitea-Actions: + env: + RUNNER_TOOL_CACHE: /toolcache + container: + volumes: + - act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default + runs-on: ubuntu-latest + steps: + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + + - name: Compute next version + id: versioning + run: | + latest="${{ vars.VERSION }}" + next_version=$(echo "$latest" | awk -F. -v OFS=. '{$NF += 1 ; print}') + echo "next_version=$next_version" >> $GITHUB_ENV + echo "Variables used :" + echo "------------------------------------------------" + echo "Next version: $next_version" + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /opt/hostedtoolcache/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + + - name: inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.0 + with: + cache-source: /opt/hostedtoolcache/pip + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to gitea + uses: docker/login-action@v3 + with: + registry: gitea.tryton.geeraert.eu + username: ${{ secrets.USERNAME_GITEA }} + password: ${{ secrets.PASSWORD_GITEA }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: | + gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest:latest + gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest:${{ env.next_version }} + cache-from: type=local,src=/opt/hostedtoolcache/.buildx-cache + cache-to: type=local,dest=/opt/hostedtoolcache/.buildx-cache-new,mode=max + + - name: Move cache + run: | + rm -rf /opt/hostedtoolcache/.buildx-cache + mv /opt/hostedtoolcache/.buildx-cache-new /opt/hostedtoolcache/.buildx-cache + + - name: update version in the variable + run: | + curl -X PUT -H "Content-Type: application/json" \ + --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \ + https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION \ + -d "{\"Value\":\"$next_version\"}" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..86fcb76 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM debian:stable-slim +RUN apt-get update \ + && apt-get install nodejs docker -y