Create main.yml #1
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
name: Deploy Server | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy using ssh | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: 22 | |
script: | | |
cd /home/proyecto/VlsmCalculator/ | |
git pull origin main | |
git status | |
docker stop vlsmcalculator-app | |
docker rm vlsmcalculator-app | |
docker build -t vlsmcalculator . | |
docker run -dit -p 5018:80 --restart unless-stopped --name vlsmcalculator-app vlsmcalculator |