Skip to content

Commit

Permalink
Build both platforms on the same machine
Browse files Browse the repository at this point in the history
  • Loading branch information
d61h6k4 committed Jun 19, 2023
1 parent 59639bb commit d149c55
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,7 @@ jobs:
image_tag: ${{ steps.set_output.outputs.image_tag }}
# Return 'true' if tag version is equal or higher than the latest tagged Rasa version
is_newest_version: ${{ steps.rasa_get_version.outputs.is_newest_version }}
strategy:
matrix:
arch: [linux/amd64, linux/arm64]

steps:
# Due to an issue with checking out a wrong commit, we make sure
# to checkout HEAD commit for a pull request.
Expand Down Expand Up @@ -912,51 +910,51 @@ jobs:
if: steps.check_image.outputs.base_exists == 'false' || env.IS_TAG_BUILD == 'true'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base
- name: Push Docker base image if it's not building from a fork ⬆
if: (steps.check_image.outputs.base_exists == 'false' || env.IS_TAG_BUILD == 'true') && github.event.pull_request.head.repo.owner.login == 'RasaHQ'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base --push
- name: Build Docker mitie base image 🛠
if: steps.check_image.outputs.base_mitie_exists == 'false' || steps.check_image.outputs.base_exists == 'false'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_mitie_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-mitie
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-mitie
- name: Push Docker mitie base image if it's not building from a fork ⬆
if: (steps.check_image.outputs.base_mitie_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_mitie_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-mitie --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-mitie --push
- name: Build Docker poetry base image 🛠
if: steps.check_image.outputs.base_poetry_exists == 'false' || steps.check_image.outputs.base_exists == 'false'
run: |
export IMAGE_TAG=${{ env.POETRY_VERSION }}
export BASE_IMAGE_HASH=${{ steps.check_image.outputs.base_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-poetry
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-poetry
- name: Push Docker poetry base image if it's not building from a fork ⬆
if: (steps.check_image.outputs.base_poetry_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ'
run: |
export IMAGE_TAG=${{ env.POETRY_VERSION }}
export BASE_IMAGE_HASH=${{ steps.check_image.outputs.base_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-poetry --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-poetry --push
- name: Build Docker builder base image 🛠
if: steps.check_image.outputs.base_builder_exists == 'false' || steps.check_image.outputs.base_exists == 'false'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_builder_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-builder
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-builder
- name: Push Docker builder base image if it's not building from a fork ⬆
if: (steps.check_image.outputs.base_builder_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ'
run: |
export IMAGE_TAG=${{ steps.check_image.outputs.base_builder_image_hash }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-builder --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-builder --push
# Set environment variables for a pull request
#
Expand Down Expand Up @@ -1013,7 +1011,6 @@ jobs:
strategy:
matrix:
image: [default, full, mitie-en, spacy-de, spacy-it, spacy-en]
arch: [linux/amd64, linux/arm64]

steps:
# Due to an issue with checking out a wrong commit, we make sure
Expand Down Expand Up @@ -1073,19 +1070,19 @@ jobs:
- name: Build Docker image
if: needs.changes.outputs.docker == 'true'
run: |
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }}
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }}
- name: Push image with main tag 📦
if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'RasaHQ/rasa'
run: |
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }} --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push
- name: Push image with ${{github.ref}} tag 📦
if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && env.IS_TAG_BUILD == 'true' && github.repository == 'RasaHQ/rasa'
run: |
IS_NEWEST_VERSION=${{ needs.build_docker_base_images_and_set_env.outputs.is_newest_version }}
docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }} --push
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push
# Tag the image as latest
if [[ "${IS_NEWEST_VERSION}" == "true" ]]; then
Expand Down

0 comments on commit d149c55

Please sign in to comment.