diff options
author | 2023-03-18 03:49:47 +0400 | |
---|---|---|
committer | 2023-03-18 05:57:15 +0400 | |
commit | 3d9eff479c156f78eb1e71f2df42340327820909 (patch) | |
tree | b8a7ec6387c7508908a5f8597c5152f363653758 /.github | |
parent | Document Python Version Selection (diff) |
Add Slim Imagemulti-version
Adds an image with only one python version installed. This can be useful
in development environments for other projects where the multi-version
features are less useful than a more efficient container.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/deploy.yaml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d8ad66b..48e66dd 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -22,6 +22,12 @@ jobs: with: name: ${{ inputs.artifact }} + - name: Set up Python + id: python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + # Load the image to make use of common layers during the final build. - name: Load image from archive run: docker load -i ${{ inputs.artifact }}.tar @@ -106,3 +112,24 @@ jobs: tags: | ghcr.io/python-discord/snekbox-venv:latest ghcr.io/python-discord/snekbox-venv:${{ inputs.version }} + + # Build a lightweight image with a singular python version + - name: Regenerate dockerfile + run: python scripts/set_versions.py + env: + VERSIONS_CONFIG: config/versions-light.json + + - name: Build & push slim image + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + push: true + cache-from: | + ghcr.io/python-discord/snekbox-base:latest + ghcr.io/python-discord/snekbox-venv:latest + ghcr.io/python-discord/snekbox:latest + cache-to: type=inline + tags: | + ghcr.io/python-discord/snekbox:latest-slim + ghcr.io/python-discord/snekbox:${{ inputs.version }}-slim |