Skip to content

Commit a1b1f79

Browse files
committed
Fix: GitHub Actions deprecation warnings and deployment protection rules
1 parent 07d3919 commit a1b1f79

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ jobs:
127127
draft: false
128128
prerelease: false
129129

130-
# Deploy web application to GitHub Pages
130+
# Deploy web application to GitHub Pages (only on main branch, not tags)
131131
deploy-web:
132132
runs-on: ubuntu-latest
133133
needs: test
134-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
134+
if: github.ref == 'refs/heads/main'
135135
name: Deploy Web to GitHub Pages
136136

137137
permissions:
@@ -205,4 +205,31 @@ jobs:
205205
echo "[INFO] No wwwroot subdirectory - using publish/ as deployment root"
206206
DEPLOY_DIR="publish"
207207
fi
208-
208+
209+
# Add .nojekyll to prevent GitHub Pages from processing files
210+
touch $DEPLOY_DIR/.nojekyll
211+
echo "[INFO] Created .nojekyll file"
212+
213+
# Add CNAME file for custom domain
214+
echo "schema.magicsuite.net" > $DEPLOY_DIR/CNAME
215+
echo "[INFO] Created CNAME file with custom domain"
216+
217+
# Verify index.html exists
218+
if [ ! -f "$DEPLOY_DIR/index.html" ]; then
219+
echo "[ERROR] index.html not found in $DEPLOY_DIR"
220+
ls -la $DEPLOY_DIR/
221+
exit 1
222+
fi
223+
224+
echo "[INFO] Configuration complete"
225+
echo "[INFO] Deployment directory: $DEPLOY_DIR"
226+
echo "DEPLOY_DIR=$DEPLOY_DIR" >> $GITHUB_ENV
227+
228+
- name: Upload artifact
229+
uses: actions/upload-pages-artifact@v3
230+
with:
231+
path: ${{ env.DEPLOY_DIR }}
232+
233+
- name: Deploy to GitHub Pages
234+
id: deployment
235+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)