From 9c224dcf1a6e21fa84cc0612e0d1681ae46fa239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20SALVI?= Date: Sat, 21 Dec 2024 18:55:58 +0100 Subject: [PATCH] Action: build custom image --- .gitea/gitea-ci.yaml | 22 ++++++++++++++++++++++ Dockerfile | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .gitea/gitea-ci.yaml diff --git a/.gitea/gitea-ci.yaml b/.gitea/gitea-ci.yaml new file mode 100644 index 0000000..b83a6ee --- /dev/null +++ b/.gitea/gitea-ci.yaml @@ -0,0 +1,22 @@ +name: Build And Test +run-name: ${{ gitea.actor }} is runs ci pipeline +on: [ push ] + +jobs: + publish: + runs-on: runner-custom + if: gitea.ref == 'refs/heads/main' + steps: + - uses: https://github.com/actions/checkout@v4 + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."git.unixyourbrain.org"] + - name: Build and push Docker image + uses: https://github.com/docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: git.unixyourbrain.org/runner-custom:${{gitea.sha}},git.unixyourbrain.org/runner-custom:latest diff --git a/Dockerfile b/Dockerfile index 26a9579..72aed85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ FROM archlinux:latest -RUN pacman -Syu --noconfirm && pacman -S --noconfirm docker docker-buildx docker-compose git ansible +RUN pacman -Sy --noconfirm +RUN pacman -S --noconfirm docker docker-buildx docker-compose && rm /var/cache/pacman/pkg/* +RUN pacman -S --noconfirm git && rm /var/cache/pacman/pkg/* + RUN mkdir -p /workspace