fix(ci): restore deploy.yml to last working version and remove test workflow
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 3s
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 3s
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -37,6 +37,44 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: 🧹 Maintenance (High Density Cleanup)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "=== System Disk Usage ==="
|
||||||
|
df -h || true
|
||||||
|
echo "=== Tool Cache Usage ==="
|
||||||
|
du -sh /opt/hostedtoolcache/* || true
|
||||||
|
du -sh /opt/hostedtoolcache/.[!.]* || true
|
||||||
|
echo "Purging old tool caches..."
|
||||||
|
rm -rf /opt/hostedtoolcache/* || true
|
||||||
|
rm -rf /opt/hostedtoolcache/.[!.]* || true
|
||||||
|
echo "=== Host Disk Usage ==="
|
||||||
|
docker run --rm -v /:/host-root alpine df -h || true
|
||||||
|
echo "=== Host Inode Usage ==="
|
||||||
|
docker run --rm -v /:/host-root alpine df -i || true
|
||||||
|
echo "=== Running Host Containers ==="
|
||||||
|
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}" || true
|
||||||
|
echo "=== Host Docker Info ==="
|
||||||
|
docker info || true
|
||||||
|
echo "Pruning host Buildkit builder caches aggressively..."
|
||||||
|
for container in $(docker ps --filter "name=buildx_buildkit_builder" --format "{{.Names}}"); do
|
||||||
|
echo "Pruning Buildkit inside container: $container"
|
||||||
|
docker exec -i "$container" buildctl prune --all || true
|
||||||
|
done
|
||||||
|
echo "Removing buildkit builder containers to clear overlay storage..."
|
||||||
|
containers=$(docker ps -a --filter "name=buildx_buildkit_builder" -q)
|
||||||
|
if [ -n "$containers" ]; then
|
||||||
|
docker rm -f $containers || true
|
||||||
|
fi
|
||||||
|
echo "=== Truncating host Docker container log files ==="
|
||||||
|
docker run --rm -v /:/host-root alpine sh -c "truncate -s 0 /host-root/mnt/HC_Volume_104796416/docker/containers/*/*.log" || true
|
||||||
|
echo "Purging old build layers, unused volumes and images..."
|
||||||
|
docker builder prune -a -f || true
|
||||||
|
docker volume prune -f || true
|
||||||
|
docker system prune -a -f --volumes || true
|
||||||
|
echo "=== System Disk Usage After Prune ==="
|
||||||
|
df -h || true
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -52,10 +90,10 @@ jobs:
|
|||||||
PRJ="etib"
|
PRJ="etib"
|
||||||
|
|
||||||
if [[ "${{ github.ref_type }}" == "branch" && "$REF" == "main" ]]; then
|
if [[ "${{ github.ref_type }}" == "branch" && "$REF" == "main" ]]; then
|
||||||
TARGET="staging"
|
TARGET="testing"
|
||||||
IMAGE_TAG="main-${SHORT_SHA}"
|
IMAGE_TAG="main-${SHORT_SHA}"
|
||||||
ENV_FILE=".env.staging"
|
ENV_FILE=".env.testing"
|
||||||
TRAEFIK_HOST="staging.${DOMAIN}"
|
TRAEFIK_HOST="test.${DOMAIN}"
|
||||||
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
|
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
|
||||||
if [[ "$REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ "$REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
TARGET="production"
|
TARGET="production"
|
||||||
@@ -186,30 +224,33 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: bash scripts/registry-auth.sh
|
run: bash scripts/registry-auth.sh
|
||||||
|
|
||||||
- name: 🐳 Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver: docker
|
|
||||||
- name: 🔐 Registry Login
|
- name: 🔐 Registry Login
|
||||||
run: echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
run: echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
- name: 🏗️ Build and Push
|
- name: 🏗️ Build and Push (Native Docker Buildkit)
|
||||||
uses: docker/build-push-action@v5
|
env:
|
||||||
with:
|
NEXT_PUBLIC_BASE_URL: ${{ needs.prepare.outputs.next_public_url }}
|
||||||
context: .
|
NEXT_PUBLIC_TARGET: ${{ needs.prepare.outputs.target }}
|
||||||
push: true
|
NEXT_PUBLIC_APP_VERSION: ${{ needs.prepare.outputs.image_tag }}
|
||||||
provenance: false
|
UMAMI_WEBSITE_ID: ${{ secrets.UMAMI_WEBSITE_ID || vars.UMAMI_WEBSITE_ID }}
|
||||||
platforms: linux/amd64
|
UMAMI_API_ENDPOINT: ${{ secrets.UMAMI_API_ENDPOINT || vars.UMAMI_API_ENDPOINT || 'https://analytics.infra.mintel.me' }}
|
||||||
build-args: |
|
NPM_TOKEN: ${{ steps.auth.outputs.working_token }}
|
||||||
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_url }}
|
NPM_DOMAIN: ${{ steps.auth.outputs.working_domain }}
|
||||||
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}
|
IMAGE_TAG: ${{ needs.prepare.outputs.image_tag }}
|
||||||
NEXT_PUBLIC_APP_VERSION=${{ needs.prepare.outputs.image_tag }}
|
run: |
|
||||||
UMAMI_WEBSITE_ID=${{ secrets.UMAMI_WEBSITE_ID || vars.UMAMI_WEBSITE_ID }}
|
echo "$NPM_TOKEN" > npm_token.txt
|
||||||
UMAMI_API_ENDPOINT=${{ secrets.UMAMI_API_ENDPOINT || vars.UMAMI_API_ENDPOINT || 'https://analytics.infra.mintel.me' }}
|
DOCKER_BUILDKIT=1 docker build \
|
||||||
NPM_TOKEN=${{ steps.auth.outputs.working_token }}
|
--secret id=NPM_TOKEN,src=npm_token.txt \
|
||||||
NPM_DOMAIN=${{ steps.auth.outputs.working_domain }}
|
--build-arg NEXT_PUBLIC_BASE_URL="$NEXT_PUBLIC_BASE_URL" \
|
||||||
tags: registry.infra.mintel.me/mintel/e-tib.com:${{ needs.prepare.outputs.image_tag }}
|
--build-arg NEXT_PUBLIC_TARGET="$NEXT_PUBLIC_TARGET" \
|
||||||
secrets: |
|
--build-arg NEXT_PUBLIC_APP_VERSION="$IMAGE_TAG" \
|
||||||
"NPM_TOKEN=${{ steps.auth.outputs.working_token }}"
|
--build-arg UMAMI_WEBSITE_ID="$UMAMI_WEBSITE_ID" \
|
||||||
|
--build-arg UMAMI_API_ENDPOINT="$UMAMI_API_ENDPOINT" \
|
||||||
|
--build-arg NPM_TOKEN="$NPM_TOKEN" \
|
||||||
|
--build-arg NPM_DOMAIN="$NPM_DOMAIN" \
|
||||||
|
-t registry.infra.mintel.me/mintel/e-tib.com:"$IMAGE_TAG" \
|
||||||
|
.
|
||||||
|
docker push registry.infra.mintel.me/mintel/e-tib.com:"$IMAGE_TAG"
|
||||||
|
rm -f npm_token.txt
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
# JOB 4: Deploy
|
# JOB 4: Deploy
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
name: Test Docker Host
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: docker:24-dind
|
|
||||||
options: --privileged
|
|
||||||
env:
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
steps:
|
|
||||||
- run: docker info
|
|
||||||
Reference in New Issue
Block a user