Skip to content

Commit

Permalink
Updates for streamlit, django and fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
willemcdejongh committed Jan 17, 2025
1 parent 7e21b66 commit 69fff8a
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 35 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,36 @@ permissions:
contents: read

jobs:
build-python-3-9-12:
build-django-images:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: python
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_NAMESPACE }}/python:3.9.12
- name: Discover and Build Images
run: |
cd django
for dir in */; do
# Extract version from the directory name
version=${dir%/}
echo "Building and pushing image for Python $version"
# Build and push the Docker image for this version
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
--tag ${{ vars.DOCKERHUB_NAMESPACE }}/django:$version \
--file "$dir/Dockerfile" \
"$dir"
done
26 changes: 18 additions & 8 deletions .github/workflows/fastapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:
contents: read

jobs:
build-fastapi-app:
build-fastapi-images:

runs-on: ubuntu-latest

Expand All @@ -22,10 +22,20 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push FastAPI Image
uses: docker/build-push-action@v3
with:
context: fastapi/0.104
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_NAMESPACE }}/fastapi:0.104
- name: Discover and Build Images
run: |
cd fastapi
for dir in */; do
# Extract version from the directory name
version=${dir%/}
echo "Building and pushing image for FastAPI $version"
# Build and push the Docker image for this version
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
--tag ${{ vars.DOCKERHUB_NAMESPACE }}/fastapi:$version \
--file "$dir/Dockerfile" \
"$dir"
done
8 changes: 4 additions & 4 deletions .github/workflows/python-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/[email protected]
with:
Expand All @@ -26,7 +26,7 @@ jobs:
run: |
cd python
for dir in */; do
# Extract Python version from the directory name
# Extract version from the directory name
version=${dir%/}
echo "Building and pushing image for Python $version"
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/streamlit.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
name: Build Python Images
name: Build Streamlit Images

on: workflow_dispatch

permissions:
contents: read

jobs:
build-python-3-9-12:
build-streamlit-images:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: python
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_NAMESPACE }}/python:3.9.12
- name: Discover and Build Images
run: |
cd streamlit
for dir in */; do
# Extract version from the directory name
version=${dir%/}
echo "Building and pushing image for Python $version"
# Build and push the Docker image for this version
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
--tag ${{ vars.DOCKERHUB_NAMESPACE }}/streamlit:$version \
--file "$dir/Dockerfile" \
"$dir"
done
File renamed without changes.

0 comments on commit 69fff8a

Please sign in to comment.