everyteen-be-app CD #3
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: everyteen-be-app CD | |
on: | |
workflow_run: | |
workflows: | |
- everyteen-be-app CI | |
types: | |
- completed | |
env: | |
REGISTRY: docker.io | |
IMAGE_NAME: be-everyteen-app | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
- name: 🔑 executing remote ssh && deploy with docker-compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST_NAME }} | |
username: ubuntu | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest | |
cd ${{ secrets.DOCKER_COMPOSE_PATH }} | |
docker-compose down | |
docker-compose up -d | |
docker image prune -f | |
docker ps -a |