Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiorowski committed Nov 16, 2023
1 parent 74e4826 commit 859fed4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/deploy-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: appleboy/[email protected]
with:
host: 65.108.61.163
username: mat
key: ${{ secrets.SSH_KEY }}
script_stop: true
command_timeout: 60m
script: |
whoami
cd /home/mat/sgsg
git checkout release
git pull
docker compose -f docker-compose.server.yml up -d --build
docker system prune -f
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/key
chmod 600 ~/.ssh/key
cat >>~/.ssh/config <<END
Host prod
HostName 65.108.61.163
User mat
IdentityFile ~/.ssh/key
StrictHostKeyChecking no
END
- name: Stop the server
run: ssh prod 'cd /home/mat/sgsg/ && docker compose stop'

- name: Check out the source
run: ssh prod 'cd /home/mat/sgsg/ && git checkout release && git pull'

- name: Start the server
run: ssh prod 'cd /home/mat/sgsg/ && docker compose -f docker-compose.server.yml up -d --build'
26 changes: 13 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ on:
- release

jobs:
# lint-client:
# uses: ./.github/workflows/lint-client.yml
lint-client:
uses: ./.github/workflows/lint-client.yml
deploy-client:
# needs:
# - lint-client
needs:
- lint-client
uses: ./.github/workflows/deploy-client.yml
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
# lint-server:
# uses: ./.github/workflows/lint-server.yml
# deploy-server:
# needs:
# - lint-server
# - deploy-client
# uses: ./.github/workflows/deploy-server.yml
# secrets:
# SSH_KEY: ${{ secrets.SSH_KEY }}
lint-server:
uses: ./.github/workflows/lint-server.yml
deploy-server:
needs:
- lint-server
- deploy-client
uses: ./.github/workflows/deploy-server.yml
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}

0 comments on commit 859fed4

Please sign in to comment.