Skip to content

Commit

Permalink
Merge pull request #217 from ZdruzenieSTROM/remote-deployment
Browse files Browse the repository at this point in the history
Reworked deployment
  • Loading branch information
mmihalik authored Jun 5, 2023
2 parents 59bd48d + cd32f90 commit 2b7da9a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
name: deploy

on:
workflow_dispatch:
on: workflow_dispatch

jobs:
deploy:
name: "Deploy"
runs-on: ubuntu-latest
steps:
- name: Temporarily save SSH key to file
run: |
echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploy_key
chmod 600 deploy_key
- name: Run deployment via SSH
run: ssh -o "StrictHostKeyChecking=no" -i deploy_key [email protected] deploy-backend

- name: Clean SSH key
run: rm -f deploy_key
- uses: actions/checkout@v3
- uses: wshihadeh/docker-deployment-action@v2
with:
remote_docker_host: [email protected]
ssh_private_key: ${{ secrets.WEBSTROM_DEPLOY_SSH_PRIVATE_KEY }}
ssh_public_key: ${{ secrets.WEBSTROM_DEPLOY_SSH_PUBLIC_KEY }}
stack_file_name: compose.yaml
args: up --build --force-recreate --detach
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM python:3.11

EXPOSE 8000

WORKDIR /app

COPY Pipfile /app
COPY Pipfile.lock /app

RUN ["pip", "install", "pipenv"]
RUN ["pipenv", "install", "--dev", "--deploy", "--system"]
RUN pip install pipenv
RUN pipenv sync --dev --system

COPY . /app

CMD ["/app/docker_entrypoint.sh"]
RUN python manage.py restoredb

EXPOSE 8000

ENTRYPOINT [ "daphne", "-b", "0.0.0.0", "-p", "8000", "webstrom.asgi:application" ]
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: "3.3"
services:
website:
build: .
image: webstrom-backend
ports:
- "8000:8000"
restart: always
5 changes: 0 additions & 5 deletions docker_entrypoint.sh

This file was deleted.

0 comments on commit 2b7da9a

Please sign in to comment.