Skip to content

Commit

Permalink
Fix up deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mhadam committed Nov 4, 2023
1 parent 8620f94 commit 6259f33
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 37 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,29 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy:
copy-to-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo Hello from Octo Organization

- name: rsync deployment
# You may pin to the exact commit or the version.
# uses: Burnett01/rsync-deployments@45d84ad5f6c174f3e0ffc50e9060a9666d09c16e
uses: Burnett01/[email protected]
with:
switches: -avzr --delete
# path: src/
# remote_path is the path under which "path" is checked out
# default is repo root - top-level files/dirs
remote_path: ${{ secrets.DEPLOY_PATH }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.CI_PRIVATE_KEY }}

restart-services:
runs-on: ubuntu-latest
steps:
- name: Execute SSH commmands on remote server
Expand All @@ -75,5 +97,5 @@ jobs:
privateKey: ${{ secrets.CI_PRIVATE_KEY }}
debug: false
command: |
/usr/bin/cp /home/princeton/config/.env.* /home/princeton/deployed/
/usr/bin/systemctl start deploy-princetonpy.service
echo "I am $NAME"
30 changes: 0 additions & 30 deletions .github/workflows/rsync.yml

This file was deleted.

4 changes: 2 additions & 2 deletions devops/systemd/princetonpy-cron.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Requires=docker.service
TimeoutStartSec=120
Restart=always
ExecStart=/usr/bin/docker compose \
-f /home/princetonpy/repos/princetonpy/docker-compose.prod.yml \
-f /home/princetonpy/deployed/docker-compose.prod.yml \
up cron
ExecStop=/usr/bin/docker compose \
-f /home/princetonpy/repos/princetonpy/docker-compose.prod.yml \
-f /home/princetonpy/deployed/docker-compose.prod.yml \
down cron

[Install]
Expand Down
6 changes: 3 additions & 3 deletions devops/systemd/princetonpy-web.service
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[Unit]
Description=PrincetonPy service
Description=PrincetonPy web service
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=120
Restart=always
ExecStart=/usr/bin/docker compose \
-f /home/princetonpy/repos/princetonpy/docker-compose.prod.yml \
-f /home/princetonpy/deployed/docker-compose.prod.yml \
up web
ExecStop=/usr/bin/docker compose \
-f /home/princetonpy/repos/princetonpy/docker-compose.prod.yml \
-f /home/princetonpy/deployed/docker-compose.prod.yml \
down web

[Install]
Expand Down

0 comments on commit 6259f33

Please sign in to comment.