Remove old code #17
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
# Deploys the application | |
on: | |
push: | |
branches: main | |
jobs: | |
deploy-api: | |
name: deploy-api | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# - uses: docker/[email protected] | |
# with: | |
# push: true | |
# set: | | |
# *.cache-from=type=gha | |
# *.cache-to=type=gha,mode=max | |
- run: sudo apt-get install sshpass | |
- run: sshpass -v -p ${{ secrets.DROPLET_PASSWORD }} scp -o StrictHostKeyChecking=no docker-compose.yml root@${{ vars.DROPLET_IP }} | |
- run: sshpass -v -p ${{ secrets.DROPLET_PASSWORD }} scp -o StrictHostKeyChecking=no Dockerfile root@${{ vars.DROPLET_IP }} | |
- uses: appleboy/ssh-action@master | |
with: | |
host: ${{ vars.DROPLET_IP }} | |
username: root | |
password: ${{ secrets.DROPLET_PASSWORD }} | |
script: | | |
cd ~ | |
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} | |
docker-compose down | |
docker-compose pull | |
docker-compose up -d | |