From e57a9fd262a951988dc98136aa3cc166988812d2 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Sun, 13 Apr 2025 10:44:10 +0100 Subject: [PATCH 1/2] Add GitHub Actions workflow to build and push multi-arch Docker image --- .github/workflows/docker.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..19068e8 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,46 @@ +name: Build and Push Docker Image (Multi-Arch) + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker image (multi-arch) + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 196c579a0afc31868d8719f45250d5a3b85c3399 Mon Sep 17 00:00:00 2001 From: goulvenb <161072438+goulvenb@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:30:53 +0200 Subject: [PATCH 2/2] docs: update readme ci: update action version --- .github/workflows/docker.yml | 4 +++- README.md | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 19068e8..9ed375f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - '*' jobs: build-and-push: @@ -36,7 +38,7 @@ jobs: images: ghcr.io/${{ github.repository }} - name: Build and push Docker image (multi-arch) - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/README.md b/README.md index 0433a66..6e23e18 100644 --- a/README.md +++ b/README.md @@ -153,11 +153,14 @@ print(result.text_content) ### Docker +We recommend you to use a specific tag, just as follow : + ```sh -docker build -t markitdown:latest . -docker run --rm -i markitdown:latest < ~/your-file.pdf > output.md +docker run --rm -i ghcr.io/microsoft/markitdown:v0.1.2 < ~/your-file.pdf > output.md ``` +It is nevertheless possible to use the `latest` or `main` tag. + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a