diff --git a/.dockerignore b/.dockerignore index 973834020..59e1c451f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,4 +6,6 @@ htmlcov logs coverage.xml notebooks - +examples +target +logprep.egg-info diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index bddc9b12c..2f94ccc69 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -14,15 +14,37 @@ on: jobs: containerbuild: + timeout-minutes: 20 runs-on: ubuntu-latest strategy: matrix: python-version: ["3.11", "3.12", "3.13"] - steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Set up SSH + uses: MrSquaare/ssh-setup-action@v3 + with: + host: ${{ secrets.DOCKER_BUILD_SERVER_01 }} + private-key: ${{ secrets.DOCKER_BUILD_SERVER_IDENTITY_FILE }} + + - name: Set up SSH + uses: MrSquaare/ssh-setup-action@v3 + with: + host: ${{ secrets.DOCKER_BUILD_SERVER_02 }} + private-key: ${{ secrets.DOCKER_BUILD_SERVER_IDENTITY_FILE }} + + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: | + { + "features": { + "containerd-snapshotter": true + } + } - name: Login to GitHub Container Registry uses: docker/login-action@v2 @@ -44,42 +66,44 @@ jobs: file.write(f"tags={', '.join(full_image)}") EOF - - name: Build image and export to Docker + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64 + append: | + - endpoint: ssh://root@${{ secrets.DOCKER_BUILD_SERVER_01 }} + platforms: linux/arm64 + - endpoint: ssh://root@${{ secrets.DOCKER_BUILD_SERVER_02 }} + platforms: linux/arm64 + + - name: Build image and push to registry uses: docker/build-push-action@v6 - id: build + id: build-and-push with: context: . - load: true + push: true build-args: | LOGPREP_VERSION=${{ inputs.build-version }} PYTHON_VERSION=${{ matrix.python-version }} + tags: ${{ steps.image-tag.outputs.tags }} + platforms: "linux/arm64,linux/amd64" tags: ${{ steps.image-tag.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max - name: Extract image ID from sha256 - id: imageid + id: pushed-imageid run: | python - <