diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3e0437e..224b8ef 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -39,11 +39,32 @@ jobs: build-container: runs-on: ubuntu-latest needs: deploy + strategy: + fail-fast: false + matrix: + platform: + - amd64 + - arm64 + env: + REGISTRY_IMAGE: shiny_invoice permissions: packages: write contents: read steps: + - name: Prepare + run: | + platform=linux/${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - uses: actions/checkout@v4 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + - 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 registry uses: docker/login-action@v2 with: @@ -55,6 +76,8 @@ jobs: with: context: . push: true + platforms: linux/${{ matrix.platform }} + labels: ${{ steps.meta.outputs.labels }} tags: | - ghcr.io/${{ github.repository_owner }}/shiny_invoice:${{ github.ref_name }} - ghcr.io/${{ github.repository_owner }}/shiny_invoice:latest + ghcr.io/${{ github.repository_owner }}/${{ env.REGISTRY_IMAGE }}:${{ matrix.platform }}-${{ github.ref_name }} + ghcr.io/${{ github.repository_owner }}/${{ env.REGISTRY_IMAGE }}:${{ matrix.platform }}-latest diff --git a/Dockerfile b/Dockerfile index e39845a..1c79ae2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,18 @@ -FROM python:3.12-slim as compiler +FROM python:3.12-slim AS compiler LABEL authors="dtrai2" -ENV PYTHONUNBUFFERED 1 +ENV PYTHONUNBUFFERED=1 WORKDIR /home/app/ RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" RUN pip install -U shiny-invoice -FROM python:3.12-slim as runner +FROM python:3.12-slim AS runner LABEL authors="dtrai2" WORKDIR /home/app/ COPY --from=compiler /opt/venv /opt/venv +COPY shiny_invoice/templates/ /home/app/templates/ ENV PATH="/opt/venv/bin:$PATH" EXPOSE 8000 ENTRYPOINT ["shiny-invoice"]