update #27
This file contains hidden or 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 🔥 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
buildApp: | |
name: Build app to server | |
runs-on: ubuntu-latest | |
steps: | |
- name: install dependencies via composer | |
uses: fifsky/ssh-action@master | |
with: | |
command: | | |
cd ~/mimovel | |
git pull origin main | |
docker image prune -f | |
# Pull the latest image | |
docker build --no-cache -f Dockerfile -t mimovel:latest . | |
docker tag mimovel:latest localhost:5000/mimovel:latest | |
docker push localhost:5000/mimovel:latest | |
# Deploy the stack | |
docker stack deploy -c docker-compose.prod.yml mimovel -d | |
# Optional: Clean up unused images | |
docker image prune -f | |
host: ${{ secrets.PRODUCTION_SSH_REMOTE_HOSTNAME }} | |
user: ${{ secrets.SSH_DEPLOY_USENAME }} | |
key: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }} | |
args: '-tt -vvv' |