Skip to content

Commit aa4768a

Browse files
committed
fix(cd): remove PR trigger and invalid job if; run only on push/workflow_dispatch; fix frontend Dockerfile missing public copy
1 parent 08a623d commit aa4768a

2 files changed

Lines changed: 0 additions & 28 deletions

File tree

.github/workflows/cd.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: CD
33
on:
44
push:
55
branches: [ main ]
6-
pull_request_target:
7-
branches: [ main ]
86
workflow_dispatch:
97

108
permissions:
@@ -20,19 +18,8 @@ jobs:
2018
outputs:
2119
backend_image: ${{ steps.tags.outputs.backend }}
2220
frontend_image: ${{ steps.tags.outputs.frontend }}
23-
# Only run on PRs originating from this repo to avoid exposing secrets to forks
24-
if: ${{ github.event_name != 'pull_request_target' || github.event.pull_request.head.repo.full_name == github.repository }}
2521
steps:
26-
- name: Select ref
27-
run: |
28-
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
29-
echo "REF=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
30-
else
31-
echo "REF=${GITHUB_SHA}" >> $GITHUB_ENV
32-
fi
3322
- uses: actions/checkout@v4
34-
with:
35-
ref: ${{ env.REF }}
3623

3724
- name: Derive lowercase image repo
3825
run: |
@@ -89,16 +76,7 @@ jobs:
8976
group: prod-deploy
9077
cancel-in-progress: false
9178
steps:
92-
- name: Select ref
93-
run: |
94-
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
95-
echo "REF=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
96-
else
97-
echo "REF=${GITHUB_SHA}" >> $GITHUB_ENV
98-
fi
9979
- uses: actions/checkout@v4
100-
with:
101-
ref: ${{ env.REF }}
10280

10381
- name: Verify required secrets are present
10482
env:
@@ -109,11 +87,6 @@ jobs:
10987
for v in SSH_HOST SSH_USER SSH_PRIVATE_KEY; do
11088
if [ -z "${!v}" ]; then echo "Missing secret: $v"; exit 1; fi
11189
done
112-
- name: Verify PR origin (internal only)
113-
if: ${{ github.event_name == 'pull_request_target' }}
114-
run: |
115-
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
116-
echo "Refusing to deploy from external fork PR"; exit 1; fi
11790
11891
- name: Upload docker-compose file
11992
uses: appleboy/scp-action@v0.1.7

frontend/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ WORKDIR /app
1414
ENV NODE_ENV=production
1515
COPY --from=builder /app/.next ./.next
1616
COPY --from=builder /app/node_modules ./node_modules
17-
COPY --from=builder /app/public ./public
1817
COPY --from=builder /app/package.json ./package.json
1918
COPY --from=builder /app/next.config.js ./next.config.js
2019
EXPOSE 3000

0 commit comments

Comments
 (0)