Skip to content

Commit

Permalink
Update Dockerfile and publish workflow (#14)
Browse files Browse the repository at this point in the history
- Add python version arg to Dockerfile
- Publish workflow
  - Add support for publishing pre-release images
  - Add support for manually building off a git ref

Signed-off-by: Wade Barnes <[email protected]>
  • Loading branch information
WadeBarnes authored Apr 12, 2023
1 parent dfe010a commit 4a8e253
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: Publish ACA-Py-Wallet-Upgrade Image
run-name: Publish ACA-Py-Wallet-Upgrade ${{ inputs.tag || github.event.release.tag_name }} Image
on:
release:
types: [released]
types: [published]

workflow_dispatch:
inputs:
tag:
description: 'Image tag'
required: true
type: string
ref:
description: 'Optional - The branch, tag or SHA to checkout.'
required: false
type: string

jobs:
publish-image:
Expand All @@ -23,6 +27,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref || '' }}

- name: Gather image info
id: info
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM --platform=linux/amd64 python:3.10-slim AS base
ARG python_version=3.10
FROM --platform=linux/amd64 python:${python_version}-slim AS base

WORKDIR /usr/src/app
# Install and configure poetry

# Install and configure poetry
ENV POETRY_VERSION=1.3.2
ENV POETRY_HOME=/opt/poetry

Expand All @@ -20,9 +21,10 @@ COPY tests/ tests/
RUN poetry build


FROM --platform=linux/amd64 python:3.10-slim AS askar-upgrade
FROM --platform=linux/amd64 python:${python_version}-slim AS askar-upgrade
COPY --from=base /usr/src/app/dist/acapy_wallet_upgrade-*-py3-none-any.whl /tmp/.

RUN pip install /tmp/acapy_wallet_upgrade-*-py3-none-any.whl && \
rm /tmp/acapy_wallet_upgrade-*

ENTRYPOINT /bin/bash

0 comments on commit 4a8e253

Please sign in to comment.