From e11887b989314b23667ed42cfe20f9be24ae8493 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Mon, 7 Sep 2026 17:04:54 -0400 Subject: [PATCH] workflow for publishing image to GitHub registry Dockerfile and workflow for publishing a Docker image to GitHub's container registry. As a first draft * this is a separate workflow * the workflow is manually dispatched * push/push-to-registry are set to false --- .github/workflows/docker_publish.yml | 51 ++++++++++++++++++++++++++++ Dockerfile | 15 ++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/docker_publish.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml new file mode 100644 index 00000000..a0434c36 --- /dev/null +++ b/.github/workflows/docker_publish.yml @@ -0,0 +1,51 @@ +name: Publish to GitHub Container Registry + +on: + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + attestations: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Log in to the Container registry + uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 + with: + context: . + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..675ca690 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.14 + +RUN apt-get update -qq && \ + apt-get install -y --no-install-recommends --no-install-suggests -qq \ + fzf \ + && \ + apt-get clean autoclean && \ + apt-get autoremove --yes && \ + rm -rf /var/lib/{apt,dpkg,cache,log}/ + +COPY . /app + +RUN cd /app && pip install -e .[llm,dataframe] + +CMD ["mycli", "--help"]