diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml new file mode 100644 index 0000000..72ab24c --- /dev/null +++ b/.github/workflows/deploy-test.yaml @@ -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: webstrom@server.strom.sk + 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 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..1c7f64f --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -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: webstrom@server.strom.sk + 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 diff --git a/compose-test.yaml b/compose-test.yaml index 08e332d..eee77e3 100644 --- a/compose-test.yaml +++ b/compose-test.yaml @@ -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: diff --git a/compose.yaml b/compose.yaml index 5dbaa07..ad91056 100644 --- a/compose.yaml +++ b/compose.yaml @@ -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: