From f3965959bc7dd581b1cc30048fd87e79683b8ae5 Mon Sep 17 00:00:00 2001 From: Phil Skentelbery Date: Sun, 23 Nov 2025 20:09:12 -0700 Subject: [PATCH] ci: Replace GitLab CI with Gitea Actions workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switched from GitLab CI to Gitea Actions for container builds. Triggers on version tags, pushes to Gitea Container Registry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitea/workflows/build-container.yml | 45 ++++++++++++++++++++++++++++ .gitlab-ci.yml | 40 ------------------------- 2 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 .gitea/workflows/build-container.yml delete mode 100644 .gitlab-ci.yml diff --git a/.gitea/workflows/build-container.yml b/.gitea/workflows/build-container.yml new file mode 100644 index 0000000..bd160ef --- /dev/null +++ b/.gitea/workflows/build-container.yml @@ -0,0 +1,45 @@ +# Gitea Actions workflow for StarPunk +# Builds and pushes container images on version tags + +name: Build Container + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract registry URL + id: registry + run: | + # Extract hostname from server URL (remove protocol) + REGISTRY_URL=$(echo "${{ github.server_url }}" | sed 's|https://||' | sed 's|http://||') + echo "url=${REGISTRY_URL}" >> $GITHUB_OUTPUT + + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ steps.registry.outputs.url }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Containerfile + push: true + tags: | + ${{ steps.registry.outputs.url }}/${{ github.repository }}:${{ github.ref_name }} + ${{ steps.registry.outputs.url }}/${{ github.repository }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index efb3eb9..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,40 +0,0 @@ -# GitLab CI/CD Pipeline for StarPunk -# Builds and pushes container images on version tags - -stages: - - build - -variables: - # Required for Docker-in-Docker - DOCKER_TLS_CERTDIR: "/certs" - # Use overlay2 driver for better performance - DOCKER_DRIVER: overlay2 - -# Build and push container image -build-container: - stage: build - image: docker:24 - services: - - docker:24-dind - # Only trigger on version tags (e.g., v0.9.5, v1.0.0) - rules: - - if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ - before_script: - # Login to GitLab Container Registry - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - script: - # Build the container image with both version and latest tags - - | - docker build \ - --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG \ - --tag $CI_REGISTRY_IMAGE:latest \ - --file Containerfile \ - . - # Push both tags to the registry - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG - - docker push $CI_REGISTRY_IMAGE:latest - # Cache Docker layers between builds - cache: - key: docker-$CI_COMMIT_REF_SLUG - paths: - - .docker-cache