Skip to content

Commit

Permalink
Try deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoff97 committed Sep 28, 2024
1 parent 79c9baa commit 9289056
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,30 @@ jobs:
tags: hoff97/hikeandfly:latest
cache-from: type=registry,ref=hoff97/hikeandfly:latest
cache-to: type=inline
deploy:
name: "Deploy to server"
runs-on: ubuntu-latest
needs: docker
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/prod.key
chmod 600 ~/.ssh/prod.key
cat >>~/.ssh/config <<END
Host prod
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/prod.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.SSH_USERNAME }}
SSH_KEY: ${{ secrets.SSHKEY }}
SSH_HOST: ${{ secrets.HOST }}

- name: Stop the server
run: ssh prod 'docker stop hoff97hikeandfly && docker rm hoff97hikeandfly && docker image rm hoff97/hikeandfly'

- name: Start the server
run: ssh prod 'docker pull hoff97/hikeandfly:latest && docker run -d --restart always --name hoff97hikeandfly -p 8080:8080 hoff97/hikeandfly:latest'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is a web application to calculate the glide area for paragliders.

<img src="example.png" alt="Example glide area" width="600"/>

## Running locally

The easiest way to run this application on your computer is using the provided docker image:
Expand Down
Binary file added example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9289056

Please sign in to comment.