ci: build and deploy custom images via tarball transfer
Some checks failed
Deploy Plane Project Tracker / Deploy to cisystem (push) Failing after 9s
Some checks failed
Deploy Plane Project Tracker / Deploy to cisystem (push) Failing after 9s
This commit is contained in:
parent
03c6c3d479
commit
4eeaebf205
2 changed files with 24 additions and 2 deletions
|
|
@ -16,6 +16,16 @@ jobs:
|
|||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Build and Package Custom Images
|
||||
run: |
|
||||
set -e
|
||||
echo "==> Building custom images for web and api..."
|
||||
docker build -t makeplane/plane-frontend:preview -f apps/web/Dockerfile.web .
|
||||
docker build -t makeplane/plane-backend:preview -f apps/api/Dockerfile.api apps/api/
|
||||
|
||||
echo "==> Saving Docker images to tarball..."
|
||||
docker save makeplane/plane-frontend:preview makeplane/plane-backend:preview | gzip > deploy/custom-images.tar.gz
|
||||
|
||||
- name: Deploy to Host
|
||||
env:
|
||||
SSH_KEY: ${{ secrets.CISYSTEM_SSH_KEY || secrets.BETA_EC2_SSH_KEY || secrets.SSH_KEY }}
|
||||
|
|
@ -42,6 +52,7 @@ jobs:
|
|||
echo "==> Direct host access detected! Deploying locally to ${TARGET_DIR}..."
|
||||
mkdir -p "${TARGET_DIR}/patches" "${TARGET_DIR}/logs"
|
||||
cp deploy/docker-compose.yml "${TARGET_DIR}/docker-compose.yml"
|
||||
cp deploy/custom-images.tar.gz "${TARGET_DIR}/custom-images.tar.gz"
|
||||
cp -r deploy/patches/* "${TARGET_DIR}/patches/"
|
||||
cp deploy/install.sh "${TARGET_DIR}/install.sh"
|
||||
chmod +x "${TARGET_DIR}/install.sh"
|
||||
|
|
@ -76,6 +87,7 @@ jobs:
|
|||
|
||||
echo "==> Transferring deployment artifacts..."
|
||||
scp $SSH_OPTS deploy/docker-compose.yml $TARGET_USER@$TARGET_HOST:${TARGET_DIR}/docker-compose.yml
|
||||
scp $SSH_OPTS deploy/custom-images.tar.gz $TARGET_USER@$TARGET_HOST:${TARGET_DIR}/custom-images.tar.gz
|
||||
scp $SSH_OPTS deploy/patches/* $TARGET_USER@$TARGET_HOST:${TARGET_DIR}/patches/
|
||||
scp $SSH_OPTS deploy/install.sh $TARGET_USER@$TARGET_HOST:${TARGET_DIR}/install.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,18 @@ fi
|
|||
|
||||
cd "${INSTALL_DIR}"
|
||||
|
||||
echo "==> [3/6] Pulling Docker images..."
|
||||
docker compose pull web space admin live api worker beat-worker migrator plane-redis plane-mq proxy
|
||||
echo "==> [3/6] Loading or Pulling Docker images..."
|
||||
if [ -f "custom-images.tar.gz" ]; then
|
||||
echo "==> Loading custom images from tarball..."
|
||||
docker load < custom-images.tar.gz
|
||||
rm custom-images.tar.gz
|
||||
export APP_RELEASE="preview"
|
||||
echo "==> Pulling remaining images (preview)..."
|
||||
docker compose pull space admin live plane-redis plane-mq proxy
|
||||
else
|
||||
echo "==> Pulling all Docker images..."
|
||||
docker compose pull web space admin live api worker beat-worker migrator plane-redis plane-mq proxy
|
||||
fi
|
||||
|
||||
echo "==> [4/6] Executing database migrations..."
|
||||
docker compose run --rm migrator
|
||||
|
|
|
|||
Loading…
Reference in a new issue