feat: copy docker-compose.pod to server
Laravel CI-CD / Tests Unitaires (push) Successful in 21s Details
Laravel CI-CD / Build & Push Docker (push) Successful in 5s Details
Laravel CI-CD / Deploy Blue/Green (push) Failing after 15s Details

This commit is contained in:
Leon Morival 2026-05-19 12:24:14 +02:00
parent d321fd8f80
commit 1d671300f5
1 changed files with 23 additions and 5 deletions

View File

@ -68,18 +68,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout deploy files
uses: actions/checkout@v4
- name: Upload Docker Compose file
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: docker-compose.prod.yml
target: ${{ secrets.DEPLOY_PATH || '/opt/bemeal' }}
- name: Deploy via SSH (Blue/Green)
uses: appleboy/ssh-action@v1.0.3
env:
IMAGE_TAG: ${{ github.sha }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.TOKEN_GITEA }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: REGISTRY,IMAGE_NAME,IMAGE_TAG,DEPLOY_PATH,REGISTRY_USERNAME,REGISTRY_PASSWORD
envs: REGISTRY,IMAGE_NAME,IMAGE_TAG,DEPLOY_PATH
script: |
set -eu
@ -95,10 +105,18 @@ jobs:
SUDO="sudo"
fi
if [ ! -d "$APP_DIR" ]; then
echo "Missing deploy directory: $APP_DIR"
echo "Set the DEPLOY_PATH secret to the directory containing $COMPOSE_FILE."
exit 1
fi
cd "$APP_DIR"
if [ -n "${REGISTRY_PASSWORD:-}" ]; then
echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
if [ ! -f "$COMPOSE_FILE" ]; then
echo "Missing $APP_DIR/$COMPOSE_FILE"
echo "Set the DEPLOY_PATH secret to the directory containing $COMPOSE_FILE, or copy the compose file there."
exit 1
fi
if [ -f "$COMPOSE_ENV_FILE" ]; then