-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add support for multiarch builds, including ARM (e.g. Mac M1) (#347)
- Loading branch information
Showing
8 changed files
with
45 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
- cron: "0 0 * * 1" | ||
|
||
jobs: | ||
build: | ||
deploy: | ||
strategy: | ||
matrix: | ||
image: | ||
|
@@ -29,23 +29,34 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Set Dockerfile name | ||
if: matrix.image.name != 'latest' | ||
run: echo "DOCKERFILE_NAME=${{ matrix.image.name }}" >> $GITHUB_ENV | ||
- name: Set Dockerfile name latest | ||
if: matrix.image.name == 'latest' | ||
run: echo "DOCKERFILE_NAME=python${{ matrix.image.python_version }}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
python-version: "3.7" | ||
- name: Install Dependencies | ||
run: python3.7 -m pip install docker pytest | ||
- name: Deploy Image | ||
run: bash scripts/build-push.sh | ||
env: | ||
NAME: ${{ matrix.image.name }} | ||
DOCKERFILE: ${{ matrix.image.dockerfile }} | ||
PYTHON_VERSION: ${{ matrix.image.python_version }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Get date for tags | ||
run: echo "DATE_TAG=$(date -I)" >> "$GITHUB_ENV" | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: | | ||
tiangolo/uwsgi-nginx-flask:${{ matrix.image.name }} | ||
tiangolo/uwsgi-nginx-flask:${{ matrix.image.name }}-${{ env.DATE_TAG }} | ||
context: ./docker-images/ | ||
file: ./docker-images/${{ env.DOCKERFILE_NAME }}.dockerfile | ||
- name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v4 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
repository: tiangolo/uwsgi-nginx-flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
bash scripts/build.sh | ||
SLEEP_TIME=5 pytest tests |