Skip to content

Commit

Permalink
feat: Publish images on Quay.io (#4860)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <simbeh7@gmail.com>
  • Loading branch information
simster7 committed Jan 11, 2021
1 parent b674aa3 commit e3320d3
Showing 1 changed file with 45 additions and 5 deletions.
50 changes: 45 additions & 5 deletions .github/workflows/docker-image.yml
Expand Up @@ -6,7 +6,6 @@ on:
- v*
branches:
- master
- test-quay

defaults:
run:
Expand Down Expand Up @@ -36,11 +35,18 @@ jobs:
${{ runner.os }}-${{ matrix.platform }}-${{ matrix.target }}-buildx-
- name: Docker Login
uses: Azure/docker-login@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Docker Login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Docker Buildx
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -63,6 +69,14 @@ jobs:
--target $TARGET \
--tag $image_name .
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .
build-linux-arm64:
name: Build & push linux/arm64
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,11 +105,18 @@ jobs:
${{ runner.os }}-${{ matrix.platform }}-${{ matrix.target }}-buildx-
- name: Docker Login
uses: Azure/docker-login@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Docker Login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Docker Buildx
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -118,6 +139,14 @@ jobs:
--target $TARGET \
--tag $image_name .
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .
build-windows:
name: Build & push windows
runs-on: windows-2019
Expand All @@ -128,6 +157,14 @@ jobs:
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: Login to Quay
uses: Azure/docker-login@v1
with:
login-server: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}

- name: Build & Push Windows Docker Images
env:
DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }}
Expand All @@ -144,6 +181,9 @@ jobs:
image_name="${docker_org}/${target}:${tag}-windows"
docker build --target $target -t $image_name -f Dockerfile.windows .
docker push $image_name
docker tag $image_name quay.io/$image_name
docker push quay.io/$image_name
done
push-linux-amd64-images:
Expand Down Expand Up @@ -183,7 +223,7 @@ jobs:
image_name="${docker_org}/${target}:${tag}"
docker manifest create $image_name ${image_name}-linux-amd64
docker manifest create quay.io/$image_name ${image_name}-linux-amd64
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-amd64
docker manifest push $image_name
docker manifest push quay.io/$image_name
Expand Down Expand Up @@ -227,7 +267,7 @@ jobs:
if [ $target = "argoexec" ]; then
docker manifest create $image_name ${image_name}-linux-arm64 ${image_name}-linux-amd64 ${image_name}-windows
docker manifest create quay.io/$image_name ${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64 quay.io/${image_name}-windows
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64 quay.io/${image_name}-windows
else
docker manifest create $image_name ${image_name}-linux-arm64 ${image_name}-linux-amd64
docker manifest create quay.io/$image_name quay.io/${image_name}-linux-arm64 quay.io/${image_name}-linux-amd64
Expand Down

0 comments on commit e3320d3

Please sign in to comment.