Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Mihálik committed Apr 13, 2024
1 parent 6b9be65 commit 268bbf3
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/deploy-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: deploy-development

on:
push:
branches: [ multiple-environments ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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: deployment/compose-development.yaml
args: up --build --force-recreate --detach
16 changes: 16 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: deploy-production

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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: deployment/compose-production.yaml
args: up --build --force-recreate --detach
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: deploy
name: deploy-testing

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- 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
stack_file_name: deployment/compose-testing.yaml
args: up --build --force-recreate --detach
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Upgrade pip
run: pip3 install --upgrade pip
Expand All @@ -37,7 +37,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Upgrade pip
run: pip3 install --upgrade pip
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true,
},
"files.associations": {
"compose-*.yaml": "dockercompose"
},
"git.branchProtection": [
"master"
],
"git.branchProtectionPrompt": "alwaysCommitToNewBranch"
}
}
15 changes: 15 additions & 0 deletions deployment/compose-development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
webstrom:
build: ../..

image: webstrom-development

environment:
- DJANGO_SETTINGS_MODULE=webstrom.settings_development

restart: "always"

ports:
- 8930:8000
Empty file.
15 changes: 15 additions & 0 deletions deployment/compose-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
webstrom:
build: ../..

image: webstrom-testing

environment:
- DJANGO_SETTINGS_MODULE=webstrom.settings_testing

restart: "always"

ports:
- 8920:8000
7 changes: 7 additions & 0 deletions webstrom/settings_development.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pylint: disable=wildcard-import,unused-wildcard-import

from .settings import *

ALLOWED_HOSTS = [
"development.strom.sk",
]
Empty file added webstrom/settings_production.py
Empty file.
7 changes: 7 additions & 0 deletions webstrom/settings_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pylint: disable=wildcard-import,unused-wildcard-import

from .settings import *

ALLOWED_HOSTS = [
"testing.strom.sk",
]

0 comments on commit 268bbf3

Please sign in to comment.