From b0c2ea998045a0654493ac3ae2a2413e0312fc8d Mon Sep 17 00:00:00 2001 From: vlaszdunov Date: Fri, 31 May 2024 22:49:40 +0300 Subject: [PATCH] first commit --- .github/dependabot.yml | 11 +++++++++ .github/workflows/Publisher.yml | 43 +++++++++++++++++++++++++++++++++ Dockerfile | 4 +++ README.md | 12 +++++++++ 4 files changed, 70 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Publisher.yml create mode 100644 Dockerfile create mode 100644 README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..748ec06 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/.github/workflows/Publisher.yml b/.github/workflows/Publisher.yml new file mode 100644 index 0000000..dbd784e --- /dev/null +++ b/.github/workflows/Publisher.yml @@ -0,0 +1,43 @@ +name: build and push +run-name: Build and push Python images to GHCR + +on: + push: + schedule: + - cron: 0 0 * * * +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-publish: + permissions: + contents: read + packages: write + id-token: write + + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{env.REGISTRY}} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Python Images + run: | + docker build . --target III.X --tag ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.10 + docker build . --target III.XI --tag ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.11 + docker build . --target III.XII --tag ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.12 + docker build . --target latest --tag ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest + + - name: Publish Python Images + run: | + docker push ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.10 + docker push ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.11 + docker push ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:3.12 + docker push ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8708412 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.10 as III.X +FROM python:3.11 as III.XI +FROM python:3.12 as III.XII +FROM python:latest as latest diff --git a/README.md b/README.md new file mode 100644 index 0000000..1918507 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Python Docker Images + +Avaliable Versions +| Python 3.10 | Python 3.11 | Python 3.12 | Python latest | +|-------------|-------------|-------------|---------------| + +### Using as base image +If you want to use this images as Base image in your Dockerfile\ +you need to paste this instruction into Dockerfile: +```Dockerfile +FROM ghcr.io/vlaszdunov/python:replace-with-specific-version +```