Skip to content

Commit

Permalink
dockerize redbrick sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamrungta committed Mar 15, 2024
1 parent 84df4ca commit cddb7c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ jobs:
with:
name: redbrick-sdk
path: dist
retention-days: 100
retention-days: 90
- id: config
name: Config
run: |
cd dist
RB_SDK_VERSION=`ls redbrick-sdk-*.tar.gz | sed 's/redbrick-sdk-//' | sed 's/.tar.gz//'`
Expand All @@ -112,16 +113,14 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.pypi) || github.event_name == 'release')
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.pypi == 'true') || github.event_name == 'release')
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download package
uses: actions/download-artifact@v4
with:
path: .
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand All @@ -131,22 +130,20 @@ jobs:
.venv/bin/activate
pip install --upgrade pip
pip install twine
twine upload dist/*
twine upload redbrick-sdk/*
deploy-docker:
runs-on: ubuntu-latest
needs:
- build
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.docker) || github.event_name == 'release')
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.docker == 'true') || github.event_name == 'release')
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
Dockerfile
- name: Download package
uses: actions/download-artifact@v4
with:
path: .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /usr/src/lib
ENV VIRTUAL_ENV="/usr/src/lib/.venv" PATH="/usr/src/lib/.venv/bin:$PATH"
RUN python -m venv .venv && /usr/src/lib/.venv/bin/pip install --upgrade pip

COPY dist/redbrick-sdk.tar.gz ./
COPY redbrick-sdk/redbrick-sdk-*.tar.gz redbrick-sdk.tar.gz
RUN pip install redbrick-sdk.tar.gz && rm redbrick-sdk.tar.gz

WORKDIR /usr/src/app
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Changelog = "https://github.com/redbrick-ai/redbrick-sdk/releases"
[project.optional-dependencies]
dev = [
"build<=1.0.3",
"twine<=4.0.2",
"wheel<=0.42.0",
"pytest<=7.4.3",
"black<=24.1.1",
Expand Down

0 comments on commit cddb7c1

Please sign in to comment.