ci: add port 22 and sudo docker for ubuntu user
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4958a6afc2
commit
11826a63eb
1 changed files with 4 additions and 3 deletions
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
|
|
@ -18,6 +18,7 @@ jobs:
|
|||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: 22
|
||||
script_stop: true
|
||||
script: |
|
||||
set -euo pipefail
|
||||
|
|
@ -31,12 +32,12 @@ jobs:
|
|||
git -C "$PROJECT_DIR" reset --hard origin/main
|
||||
|
||||
echo "▶ Building Docker image..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" build --pull
|
||||
sudo docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" build --pull
|
||||
|
||||
echo "▶ Restarting containers..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d --remove-orphans
|
||||
sudo docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d --remove-orphans
|
||||
|
||||
echo "▶ Pruning unused images..."
|
||||
docker image prune -f
|
||||
sudo docker image prune -f
|
||||
|
||||
echo "✓ Deploy complete — $(git -C "$PROJECT_DIR" rev-parse --short HEAD)"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue