commit:     62448c9034420e277c76d703416d3260d70b6963
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 13 19:35:21 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 13 19:35:21 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=62448c90

Dockerfile: introduce pkgcheck docker on release

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++++++++++
 Dockerfile                    |  6 ++++++
 2 files changed, 49 insertions(+)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f9e1c6fc..f7911a55 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -101,3 +101,46 @@ jobs:
         files: dist/*.tar.gz
         fail_on_unmatched_files: true
         draft: true
+
+  build-and-push-docker-image:
+    if: startsWith(github.ref, 'refs/tags/')
+    needs: ["deploy"]
+    runs-on: ubuntu-latest
+    environment: release
+
+    permissions:
+      contents: read
+      packages: write
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Scrape build info
+        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
+
+      - name: Log in to the Container registry
+        uses: docker/login-action@v3
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Docker meta
+        id: meta
+        uses: docker/metadata-action@v5
+        with:
+          images: ghcr.io/pkgcore/pkgcheck
+          tags: |
+            type=semver,pattern={{version}}
+            type=sha
+
+      - name: Build and push
+        uses: docker/build-push-action@v5
+        with:
+          context: .
+          push: true
+          tags: ${{ steps.meta.outputs.tags }}
+          labels: ${{ steps.meta.outputs.labels }}
+          build-args: |
+            PKGCHECK_VERSION=${{ env.RELEASE_VERSION }}

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..42c3b37d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,6 @@
+FROM python:3-slim
+ARG PKGCHECK_VERSION
+
+RUN apt-get update && apt-get install -y git && \
+    rm -rf /var/lib/apt/lists/ /var/cache/apt && \
+    pip install pkgcheck==${PKGCHECK_VERSION} setuptools

Reply via email to