From d9eb01b526f514efad6a25c51cb75ce1b73a9675 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 10 Jan 2026 14:09:58 +0100 Subject: [PATCH] build: Deploy ImHex-Web as a docker image --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ dist/web/Host.Dockerfile | 9 ++++++++ 2 files changed, 54 insertions(+) create mode 100644 dist/web/Host.Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d14ddd315..14a840096 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1276,3 +1276,48 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: .github/scripts/delete-artifact.sh github-pages + + docker-image-deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + permissions: + contents: read + packages: write + + steps: + - name: 🧰 Checkout + uses: actions/checkout@v4 + + - name: ⬇️ Download artifact + uses: actions/download-artifact@v4 + with: + name: ImHex Web + path: out + + - name: 📜 Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: ⛓️ Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }}/imhex-web + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + + - name: 🔨 Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: dist/web/Host.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/dist/web/Host.Dockerfile b/dist/web/Host.Dockerfile new file mode 100644 index 000000000..da773b616 --- /dev/null +++ b/dist/web/Host.Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.12-slim + +WORKDIR /imhex + +COPY ./out/ . + +EXPOSE 9090 + +CMD [ "python", "/imhex/serve.py" ] \ No newline at end of file