Skip to content

Commit

Permalink
Merge pull request #143 from ZdruzenieSTROM/deploy-from-pipeline
Browse files Browse the repository at this point in the history
Add workflow to deploy
  • Loading branch information
kovacspe authored May 23, 2024
2 parents 049c36d + 4db99e0 commit b7f6ea0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 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: kos-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: kos-test/compose-test.yaml
args: up --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: workflow_dispatch

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

- 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: kos/compose.yaml
args: up --build --force-recreate --detach
9 changes: 6 additions & 3 deletions compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ services:
volumes:
- "staticfiles:/app/static"
- type: "bind"
source: "./db.sqlite3"
source: "/data/www/kos-test/db.sqlite3"
target: "/app/db.sqlite3"
- type: "bind"
source: "./media"
source: "/data/www/kos-test/media"
target: "/app/media"
- type: "bind"
source: "/data/www/kos-test/.secrets"
target: "/app/.secrets"
restart: always

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 @@ -11,15 +11,18 @@ services:
volumes:
- "staticfiles:/app/static"
- type: "bind"
source: "./db.sqlite3"
source: "/data/www/kos/db.sqlite3"
target: "/app/db.sqlite3"
- type: "bind"
source: "./media"
source: "/data/www/kos/media"
target: "/app/media"
- type: "bind"
source: "/data/www/kos/.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 b7f6ea0

Please sign in to comment.