From 9c23dc05722e84c7ad4c37cdb5cfb1bbf727ad72 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 16 Sep 2025 00:55:09 +0200 Subject: [PATCH] ci/cd --- .gitea/workflows/release.yaml | 58 +++++++++++++++++++++++++++++++++++ contrib/docker/Dockerfile | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 00000000..254726fa --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,58 @@ +name: ci + +on: + push: + branches: + - master + - staging + tags: + - '*' + +env: + IMAGE_NAME: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }} + TAG_SUFFIX: ${{ gitea.ref_type == 'tag' && gitea.ref_name || (gitea.ref_name == 'master' && 'latest' || gitea.ref_name) }} + +jobs: + docker: + runs-on: ubuntu-latest + + steps: + - name: Checkout with submodules + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.GIT_PAT }} + + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: ${{ vars.REGISTRY_URL }} + username: ${{ vars.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: remote + endpoint: ${{ env.BUILDKIT_ARM64_ENDPOINT }} + + - name: Show build context + run: | + echo "Repository: ${{ gitea.repository }}" + echo "Actor: ${{ gitea.actor }}" + echo "Ref: ${{ gitea.ref }}" + echo "SHA: ${{ gitea.sha }}" + + - name: Build and Push Docker Image + uses: docker/build-push-action@v6 + with: + context: . + file: contrib/docker/Dockerfile + platforms: linux/arm64 + build-args: | + BASE_IMAGE=debian:bullseye + GIT_REVISION=${{ gitea.sha }} + push: true + tags: | + ${{ env.IMAGE_NAME }}:${{ env.TAG_SUFFIX }} + ${{ env.IMAGE_NAME }}:${{ gitea.sha }} diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 64679fc7..0b8f4bc3 100755 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -20,7 +20,7 @@ ENV EBUSD_VERSION $EBUSD_VERSION ENV GIT_REVISION $GIT_REVISION ADD . /build -RUN RUNTEST=full GIT_REVISION=$GIT_REVISION ./make_debian.sh --with-knxd +RUN GIT_REVISION=$GIT_REVISION ./make_debian.sh --with-knxd