Fix: Use standard VS Dockerfile pattern with correct build context

This commit is contained in:
masoud
2025-12-06 15:46:01 +00:00
parent 57f73e3dcc
commit 05c378c00b
2 changed files with 31 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
name: Build and Deploy to Kubernetes
name: Build and Deploy
on:
push:
@@ -10,43 +10,17 @@ env:
IMAGE_NAME: admin/frontoffice-bff
jobs:
build-and-deploy:
build:
runs-on: ubuntu-latest
container:
image: docker:latest
options: --privileged
env:
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
NO_PROXY: localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8
steps:
- name: Install git
run: apk add --no-cache git
- name: Checkout code
uses: actions/checkout@v4
- name: Clone repo
- name: Start Docker daemon
run: |
git clone --depth 1 --branch kub-stage http://gitea-svc:3000/admin/FrontOffice.BFF.git .
- name: Start Docker daemon with insecure registry
run: |
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "gitea-svc:3000"]
}
DAEMON
mkdir -p ~/.docker
cat > ~/.docker/config.json << 'CONF'
{
"proxies": {
"default": {
"httpProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"httpsProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"noProxy": "localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8"
}
}
}
CONF
dockerd &
for i in $(seq 1 30); do
docker info >/dev/null 2>&1 && break || sleep 2
@@ -55,8 +29,9 @@ jobs:
- name: Build Docker Image
run: |
cd src/FrontOffice.BFF.WebApi
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
cd src
docker build -f FrontOffice.BFF.WebApi/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \