Skip to content

TsukiNi22/ai-utils / skills/git/ci-cd

CI and CD of a GitHub repository in Tsukini's way - the CI (build check, unit tests, style check with xstyle, coverage) and the CD (GitHub releases from the CHANGELOG, RPM/DEB packages and their gh-pages repository, container images on ghcr.io, PyPI, docs on gh-pages, dispatch to other repositories), always asking first what to run, runs the jobs in the user's Docker images (ghcr.io/tsukini22 ci / unit-tests / package / git from the docker-image repository) or else the smallest official image that has what is needed, follows his conventions (names, vars.RUNNER, ccache, set -euo pipefail, annotations, dispatch keywords), and when one of his images misses a tool, adds it to the docker-image repository (Dockerfile, version, CHANGELOG, README) with a local commit only. Used by the project setup skills (cpp-project, python-project) when the project is a GitHub repository. Use whenever the user wants a CI, a CD, a release / deployment / publication pipeline, a GitHub workflow / action, or to change one.

FileKindSize
SKILL.mdskill md9.8 KB
requires.txtmarkdown16 B
scripts/check_workflows.pyexecutablescript5.1 KB
templates/container.ymlconfig1.7 KB
templates/dispatch-repository.ymlconfig877 B
templates/pypi.ymlconfig885 B
templates/python.ymlconfig984 B
templates/release.ymlconfig1.6 KB
templates/style.ymlconfig1.2 KB

templates/container.yml

View on GitHub
name: Image - {{IMAGE_NAME}} (CD)

on:
  push:
    branches: [main]
    paths:
      - '{{IMAGE_NAME}}.Dockerfile'
      - '.github/workflows/{{WORKFLOW_FILE}}'

env:
  IMAGE_NAME: "{{IMAGE_NAME}}"
  VERSION: v1.0.0 # bumped with the CHANGELOG of the image

jobs:
  build-image:
    runs-on: ${{ vars.RUNNER }}
    permissions:
      packages: write
      contents: write

    steps:
      - run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
      - uses: actions/checkout@v5
      - uses: docker/setup-buildx-action@v4
      - uses: docker/login-action@v4
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build & push the image
        uses: docker/build-push-action@v7
        with:
          context: ./
          file: ./${{ env.IMAGE_NAME }}.Dockerfile
          push: true
          tags: |
            ghcr.io/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest
            ghcr.io/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
          labels: |
            org.opencontainers.image.version=${{ env.VERSION }}
            org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

      - name: Version tag
        run: |
          set -euo pipefail
          if git ls-remote --tags origin | grep -q "refs/tags/${IMAGE_NAME}/${VERSION}$"; then
            echo "::warning::The tag ${IMAGE_NAME}/${VERSION} already exists on the remote."
            exit 0
          fi
          git tag "${IMAGE_NAME}/${VERSION}"
          git push origin "${IMAGE_NAME}/${VERSION}"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall