Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Python package

on: [push]

env:
EXAMPLE_IMAGE_NAME: ghcr.io/descope/py-example:0.1

jobs:
build:

Expand Down Expand Up @@ -52,6 +55,21 @@ jobs:
run: |
python -m pytest tests/*

pkg:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Build package
run: |
mkdir src
Expand All @@ -61,4 +79,20 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: descope-auth-0.0.1.tar.gz
path: ./dist/descope-auth-0.0.1.tar.gz
path: ./dist/descope-auth-0.0.1.tar.gz

- run: cp ./dist/descope-auth-0.0.1.tar.gz samples/

- name: Build example docker image
working-directory: samples/
run: |
docker build . --tag ${{ env.EXAMPLE_IMAGE_NAME }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push the tagged Docker image
run: docker push ${{ env.EXAMPLE_IMAGE_NAME }}
15 changes: 15 additions & 0 deletions samples/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3

WORKDIR /home/app

COPY descope-auth-0.0.1.tar.gz /home/app

RUN pip3 install /home/app/descope-auth-0.0.1.tar.gz

ADD requirements.txt /home/app
RUN pip3 install -r requirements.txt

ADD . /home/app
CMD python3 otp_web_sample_app.py

EXPOSE 3000
5 changes: 5 additions & 0 deletions samples/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
requests
flask
flake8
PyJWT
Descope-Auth