99
1010env :
1111 REGISTRY : tpsappscriptingacr.azurecr.io
12- IMAGE_STATIC : app-scripting-editor
1312 IMAGE_API : app-scripting-editor-api
1413
1514jobs :
2423 - name : Checkout
2524 uses : actions/checkout@v4
2625
27- # --- Login to ACR (simple user/pass; or swap to azure/login + OIDC if you prefer) ---
2826 - name : Docker login to ACR
2927 uses : docker/login-action@v3
3028 with :
@@ -38,33 +36,14 @@ jobs:
3836 - name : Set up Docker Buildx
3937 uses : docker/setup-buildx-action@v3
4038
41- # ---------- Build STATIC (nginx) image ----------
42- # IMPORTANT: set context/file to your actual static image Dockerfile.
43- # If your static image is built from the repo root with ./Dockerfile.nginx, set file accordingly.
44- - name : Build & push STATIC image (nginx)
45- uses : docker/build-push-action@v6
46- with :
47- context : .
48- file : ./Dockerfile.nginx # <--- CHANGE if your static Dockerfile has a different path/name
49- push : true
50- tags : |
51- ${{ env.REGISTRY }}/${{ env.IMAGE_STATIC }}:latest
52- ${{ env.REGISTRY }}/${{ env.IMAGE_STATIC }}:${{ github.sha }}
53- cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_STATIC }}:buildcache
54- cache-to : type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_STATIC }}:buildcache,mode=max
55-
56- # ---------- Build API (Node/Express) image ----------
57- # This Dockerfile copies the built SPA from the STATIC image via:
58- # ARG REGISTRY
59- # FROM ${REGISTRY}/app-scripting-editor:latest AS web-build
60- # COPY --from=web-build /usr/share/nginx/html ./editor-dist
61- #
62- # Therefore we MUST pass REGISTRY as a build-arg.
39+ # ---- Build API (Node/Express) image ----
40+ # NOTE: Your API Dockerfile copies the SPA from ${REGISTRY}/app-scripting-editor:latest.
41+ # Make sure that image exists in ACR, or switch to the "self-contained" Dockerfile approach below.
6342 - name : Build & push API image (Node/Express + SPA)
6443 uses : docker/build-push-action@v6
6544 with :
6645 context : .
67- file : ./Dockerfile # <--- CHANGE if your API Dockerfile has a different path/name
46+ file : ./Dockerfile # change if your API Dockerfile lives elsewhere
6847 push : true
6948 build-args : |
7049 REGISTRY=${{ env.REGISTRY }}
0 commit comments