Skip to content

CD

CD #46

Workflow file for this run

name: CD
# Controls when the action will run.
on:
workflow_run:
workflows:
- "Run Tests"
- "Lint and format check"
branches:
- main
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy using ssh
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd ~/projects/wrapto
git pull
git status
docker stop wrapto-cont || true
docker rm wrapto-cont || true
docker rmi wrapto || true
docker build -t wrapto .
docker run -p 3000:3000 -d --name wrapto-cont wrapto