Skip to content

Commit

Permalink
deploy squib
Browse files Browse the repository at this point in the history
  • Loading branch information
shyanukant committed Jul 27, 2023
1 parent f5282d5 commit 74fb256
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 47 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Squib testing

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/squib .
docker push ${{ secrets.DOCKER_USERNAME }}/squib
- name: Deploy to Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP_NAME: squib
run: |
heroku container:login
heroku container:push web -a $HEROKU_APP_NAME
heroku container:release web -a $HEROKU_APP_NAME
- name: Run Tests
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
cd squib
python3 manage.py test
28 changes: 0 additions & 28 deletions .github/workflows/tests.yml

This file was deleted.

18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.10

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir virtualenv
RUN virtualenv venv

ENV PATH="/app/venv/bin:$PATH"

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE $PORT

CMD ["gunicorn", "squib.wsgi:application", "--bind", "0.0.0.0:$PORT"]
19 changes: 0 additions & 19 deletions Pipfile

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web:gunicorn squib.wsgi:application
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 74fb256

Please sign in to comment.