Skip to content

Commit

Permalink
Merge pull request #97 from NIAEFEUP/chore/prepare-for-niployments
Browse files Browse the repository at this point in the history
chore: prepare for niployments
  • Loading branch information
limwa authored Aug 14, 2024
2 parents 7e41610 + 1bf78b2 commit 493a746
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/niployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy

on:
push:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Upload to NIployments registry
uses: NIAEFEUP/[email protected]
with:
docker_dockerfile: Dockerfile
docker_context: ./django
docker_target: prod
NIPLOYMENTS_REGISTRY_URL: ${{ vars.NIPLOYMENTS_REGISTRY_URL }}
NIPLOYMENTS_REGISTRY_USERNAME: ${{ vars.NIPLOYMENTS_REGISTRY_USERNAME }}
NIPLOYMENTS_REGISTRY_PASSWORD: ${{ secrets.NIPLOYMENTS_REGISTRY_PASSWORD }}
12 changes: 11 additions & 1 deletion django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM python:3.8-slim-buster
# deps
FROM python:3.8-slim-buster AS deps

WORKDIR /usr/src/django/

Expand Down Expand Up @@ -26,3 +27,12 @@ EXPOSE 8000

COPY ./entrypoint.sh ./entrypoint.sh
ENTRYPOINT ["/usr/src/django/entrypoint.sh"]

# prod
FROM deps AS prod

COPY tts_be/ ./tts_be
COPY university/ ./university
COPY manage.py tasks.py ./

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

0 comments on commit 493a746

Please sign in to comment.