-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74e4826
commit 859fed4
Showing
2 changed files
with
33 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters