diff options
| author | saturneric <[email protected]> | 2025-11-07 21:48:49 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-07 21:48:49 +0000 |
| commit | 4672150494dbcde906fc9cf2bf9e2052bd074e9f (patch) | |
| tree | 1eb19f4a0355b7d359e46fd715884fb97520d7da | |
| parent | feat(docker): expose port 80 for container usage (diff) | |
| download | cgit-4672150494dbcde906fc9cf2bf9e2052bd074e9f.tar.gz cgit-4672150494dbcde906fc9cf2bf9e2052bd074e9f.zip | |
chore(ci): add CI workflow for Docker image build
* Introduce automated CI workflow to build and push Docker images
on push events using a custom registry and edge tags
* Enable nightly integration testing and ensure up-to-date images
are available for downstream workflows
| -rw-r--r-- | .gitea/workflows/ci.yaml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..50be25a --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,45 @@ +name: CI + +# For all pushes to the main branch run the tests and push the image to the +# GitHub registry under an edge tag so we can use it for the nightly +# integration tests +on: [push] + +jobs: + docker: + runs-on: ubuntu-latest-server + steps: + # GitHub Actions do not automatically checkout your projects. If you need the code + # you need to check it out. + - name: Checkout + uses: https://git.stdv.de/Mirrors/[email protected] + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=git.stdv.de/saturneric/cgit + VERSION=$(git rev-parse --short HEAD) + TAGS="${DOCKER_IMAGE}:${VERSION}" + TAGS="$TAGS,${DOCKER_IMAGE}:latest" + echo "tags=${TAGS}" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + id: buildx + uses: https://git.stdv.de/Mirrors/setup-buildx-action@v2 + + - name: Login to gitea + if: github.event_name != 'pull_request' + uses: https://git.stdv.de/Mirrors/login-action@v2 + with: + registry: git.stdv.de + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + id: docker_build + uses: https://git.stdv.de/Mirrors/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.prep.outputs.tags }} |
