Skip to content

Commit

Permalink
Add workflow deploying to server
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihalik committed May 22, 2024
1 parent b34db90 commit 1808d89
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/deploy-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Testing

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: mas-problem-test

- 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-test.yaml
args: --project-name mas-problem-test up mas-problem-test --build --force-recreate --detach
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Production

on: push

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: mas-problem-test

- 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: --project-name mas-problem up -p mas-problem --build --force-recreate --detach
11 changes: 6 additions & 5 deletions compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ services:
volumes:
- "staticfiles:/app/static:ro"
- type: "bind"
source: "./db.sqlite3"
source: "/data/www/mas-problem-test/db.sqlite3"
target: "/app/db.sqlite3"
- type: "bind"
source: "./media"
source: "/data/www/mas-problem-test/media"
target: "/app/media"


- type: "bind"
source: "/data/www/mas-problem-test/.secrets"
target: "/app/.secrets"

static:
image: "nginx:1.23"
image: "nginx:1.25"
depends_on:
- "website"
ports:
Expand Down
9 changes: 6 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ services:
volumes:
- "staticfiles:/app/static:ro"
- type: "bind"
source: "./db.sqlite3"
source: "/data/www/mas-problem/db.sqlite3"
target: "/app/db.sqlite3"
- type: "bind"
source: "./media"
source: "/data/www/mas-problem/media"
target: "/app/media"
- type: "bind"
source: "/data/www/mas-problem/.secrets"
target: "/app/.secrets"
restart: always

static:
image: "nginx:1.23"
image: "nginx:1.25"
depends_on:
- "website"
ports:
Expand Down

0 comments on commit 1808d89

Please sign in to comment.