260323:1316 fix CI : Verify relaase : 🐋 Login to Internal Registry #03
This commit is contained in:
+14
-12
@@ -72,29 +72,29 @@ jobs:
|
|||||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Releasing version: $VERSION"
|
echo "Releasing version: $VERSION"
|
||||||
|
|
||||||
- name: 🐋 Login to Internal Registry
|
- name: 🐋 Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_URL }}
|
registry: git.np-dms.work
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 🏗️ Build & Push Backend
|
- name: 🏗️ Build & Push Backend
|
||||||
run: |
|
run: |
|
||||||
docker build -f backend/Dockerfile \
|
docker build -f backend/Dockerfile \
|
||||||
-t ${{ secrets.REGISTRY_URL }}/lcbp3-backend:${{ steps.pkg-version.outputs.VERSION }} \
|
-t git.np-dms.work/${{ github.repository_owner }}/lcbp3-backend:${{ steps.pkg-version.outputs.VERSION }} \
|
||||||
-t ${{ secrets.REGISTRY_URL }}/lcbp3-backend:latest .
|
-t git.np-dms.work/${{ github.repository_owner }}/lcbp3-backend:latest .
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/lcbp3-backend:${{ steps.pkg-version.outputs.VERSION }}
|
docker push git.np-dms.work/${{ github.repository_owner }}/lcbp3-backend:${{ steps.pkg-version.outputs.VERSION }}
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/lcbp3-backend:latest
|
docker push git.np-dms.work/${{ github.repository_owner }}/lcbp3-backend:latest
|
||||||
|
|
||||||
- name: 🏗️ Build & Push Frontend
|
- name: 🏗️ Build & Push Frontend
|
||||||
run: |
|
run: |
|
||||||
docker build -f frontend/Dockerfile \
|
docker build -f frontend/Dockerfile \
|
||||||
--build-arg NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }} \
|
--build-arg NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }} \
|
||||||
-t ${{ secrets.REGISTRY_URL }}/lcbp3-frontend:${{ steps.pkg-version.outputs.VERSION }} \
|
-t git.np-dms.work/${{ github.repository_owner }}/lcbp3-frontend:${{ steps.pkg-version.outputs.VERSION }} \
|
||||||
-t ${{ secrets.REGISTRY_URL }}/lcbp3-frontend:latest .
|
-t git.np-dms.work/${{ github.repository_owner }}/lcbp3-frontend:latest .
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/lcbp3-frontend:${{ steps.pkg-version.outputs.VERSION }}
|
docker push git.np-dms.work/${{ github.repository_owner }}/lcbp3-frontend:${{ steps.pkg-version.outputs.VERSION }}
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/lcbp3-frontend:latest
|
docker push git.np-dms.work/${{ github.repository_owner }}/lcbp3-frontend:latest
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# JOB 3 : Deploy — Trigger Blue-Green on QNAP
|
# JOB 3 : Deploy — Trigger Blue-Green on QNAP
|
||||||
@@ -130,4 +130,6 @@ jobs:
|
|||||||
echo "🚀 Executing Blue-Green deployment..."
|
echo "🚀 Executing Blue-Green deployment..."
|
||||||
# Pass registry credentials if needed by the pull command in deploy.sh
|
# Pass registry credentials if needed by the pull command in deploy.sh
|
||||||
export DB_PASSWORD="${{ secrets.DB_PASSWORD }}"
|
export DB_PASSWORD="${{ secrets.DB_PASSWORD }}"
|
||||||
|
export REGISTRY_USER="${{ github.repository_owner }}"
|
||||||
|
export REGISTRY_TOKEN="${{ secrets.GITHUB_TOKEN }}"
|
||||||
./scripts/deploy.sh
|
./scripts/deploy.sh
|
||||||
|
|||||||
@@ -46,6 +46,16 @@ echo "✓ Backup created: $BACKUP_FILE.gz"
|
|||||||
# Step 2: Pull latest images from registry
|
# Step 2: Pull latest images from registry
|
||||||
echo "[2/9] Pulling latest Docker images from internal registry..."
|
echo "[2/9] Pulling latest Docker images from internal registry..."
|
||||||
cd "$LCBP3_DIR/$TARGET"
|
cd "$LCBP3_DIR/$TARGET"
|
||||||
|
|
||||||
|
if [ -n "$REGISTRY_TOKEN" ] && [ -n "$REGISTRY_USER" ]; then
|
||||||
|
echo "Logging into Gitea Container Registry..."
|
||||||
|
echo "$REGISTRY_TOKEN" | docker login git.np-dms.work -u "$REGISTRY_USER" --password-stdin
|
||||||
|
|
||||||
|
echo "Updating docker-compose.yml to use Gitea registry images..."
|
||||||
|
sed -i -E "s|image: (git\.np-dms\.work/[^/]+/)?lcbp3-backend|image: git.np-dms.work/$REGISTRY_USER/lcbp3-backend|g" docker-compose.yml
|
||||||
|
sed -i -E "s|image: (git\.np-dms\.work/[^/]+/)?lcbp3-frontend|image: git.np-dms.work/$REGISTRY_USER/lcbp3-frontend|g" docker-compose.yml
|
||||||
|
fi
|
||||||
|
|
||||||
docker-compose pull
|
docker-compose pull
|
||||||
echo "✓ Images pulled"
|
echo "✓ Images pulled"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user