Skip to content

Commit 5916a6f

Browse files
Merge pull request #244 from SheetMetalConnect/claude/fix-npm-ci-build-01BvXuRwduGcHjnne8sL8gKy
Fix npm CI build Docker image error
2 parents 895a2b3 + 110ce09 commit 5916a6f

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

.github/workflows/deploy-prod.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
name: Build Production Image
1+
name: CI / Build Production Image
22

3-
# Auto-build on push to main (no deploy, just build)
3+
# Tests run automatically on push to main
4+
# Docker build only runs when manually triggered
45
on:
56
push:
67
branches: [main]
8+
workflow_dispatch:
79

810
env:
911
REGISTRY: ghcr.io
10-
IMAGE_NAME: ${{ github.repository }}
1112

1213
jobs:
1314
test:
@@ -32,12 +33,18 @@ jobs:
3233
name: Build & Push Docker Image
3334
runs-on: ubuntu-latest
3435
needs: test
36+
# Only run on manual trigger
37+
if: github.event_name == 'workflow_dispatch'
3538
permissions:
3639
contents: read
3740
packages: write
3841
steps:
3942
- uses: actions/checkout@v4
4043

44+
- name: Repository name to lowercase
45+
id: repo
46+
run: echo "name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
47+
4148
- name: Get version
4249
id: version
4350
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
@@ -58,9 +65,9 @@ jobs:
5865
context: .
5966
push: true
6067
tags: |
61-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
62-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
63-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
68+
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:latest
69+
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:${{ steps.version.outputs.VERSION }}
70+
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:${{ github.sha }}
6471
build-args: |
6572
VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL_PROD }}
6673
VITE_SUPABASE_PUBLISHABLE_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY_PROD }}

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@ jobs:
114114
packages: write
115115
outputs:
116116
version: ${{ steps.version.outputs.VERSION }}
117+
image_name: ${{ steps.repo.outputs.name }}
117118
steps:
118119
- uses: actions/checkout@v4
119120

121+
- name: Repository name to lowercase
122+
id: repo
123+
run: echo "name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
124+
120125
- name: Get version
121126
id: version
122127
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
@@ -137,8 +142,8 @@ jobs:
137142
context: .
138143
push: true
139144
tags: |
140-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
141-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
145+
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:latest
146+
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:${{ steps.version.outputs.VERSION }}
142147
build-args: |
143148
VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL_PROD }}
144149
VITE_SUPABASE_PUBLISHABLE_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY_PROD }}
@@ -196,5 +201,5 @@ jobs:
196201
197202
**Docker Image:**
198203
```
199-
docker pull ghcr.io/${{ github.repository }}:${{ needs.build-and-push.outputs.version }}
204+
docker pull ghcr.io/${{ needs.build-and-push.outputs.image_name }}:${{ needs.build-and-push.outputs.version }}
200205
```

0 commit comments

Comments
 (0)