Skip to content

Commit

Permalink
dvc in deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
leosfreitas committed Dec 3, 2024
1 parent 5360c50 commit 009b103
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
username: ubuntu
key: ${{ secrets.KEY_TEST }}
port: 22
source: './app ./back ./docker-compose.yml'
source: './app ./back ./docker-compose.yml .dvc .dvcignore'
target: ~/deploy

- name: Run Deployment Commands
Expand All @@ -31,12 +31,26 @@ jobs:
key: ${{ secrets.KEY_TEST }}
port: 22
script: |
# Instalar Docker Compose se não estiver instalado
# Instalar dependências necessárias
sudo apt update
sudo apt install -y python3-pip
pip install --no-cache-dir dvc[s3] # Ajuste o tipo de remoto do DVC aqui
# Configurar acesso ao DVC remoto (se necessário)
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_KEY }}
# Ir para o diretório de deploy
cd ~/deploy
# Baixar os arquivos de modelo com DVC
dvc pull
# Subir os containers Docker
if ! [ -x "$(command -v docker-compose)" ]; then
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
cd ~/deploy
docker-compose down
docker-compose up --build -d

0 comments on commit 009b103

Please sign in to comment.