From a49527b8e67297f7e73abf57d1e62132f74645a9 Mon Sep 17 00:00:00 2001 From: chadrakdev Date: Sun, 24 May 2026 13:31:01 +0100 Subject: [PATCH 1/3] Feat: Migrate Netlify deployment process to GitHub Actions --- .github/workflows/deploy.yml | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8780fd9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,68 @@ +name: Build, Test and Deploy + +on: + push: + branches: ["main"] + +jobs: + build: + name: Build + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ + + test: + name: Test + runs-on: ubuntu-24.04 + needs: build + + steps: + - name: Run unit tests + run: echo "Tests will run here" + + deploy: + name: Deploy + runs-on: ubuntu-24.04 + needs: [ build, test ] + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + + - name: Deploy to Netlify + run: npx netlify-cli deploy --prod --dir=dist + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ vars.NETLIFY_PROJECT_ID }} + + smoke-test: + name: Post-deployment Smoke Test + runs-on: ubuntu-24.04 + needs: deploy + + steps: + - name: Run smoke tests + run: echo "Smoke tests will run here" \ No newline at end of file From a3fc24a3e72cdb3f9184db6750c9dcb9a89b11b6 Mon Sep 17 00:00:00 2001 From: chadrakdev Date: Sun, 24 May 2026 13:40:34 +0100 Subject: [PATCH 2/3] Add post-deployment smoke test --- .github/workflows/deploy.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8780fd9..1a4037e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -64,5 +64,21 @@ jobs: needs: deploy steps: - - name: Run smoke tests - run: echo "Smoke tests will run here" \ No newline at end of file + - name: Check site health + shell: bash + run: | + # Wait for deployment + sleep 30 + + URL="https://chadrak.dev/" + + HTTP_CODE=$(curl -s --fail -o /dev/null -w "%{http_code}" "$URL") + + echo "HTTP response code: $HTTP_CODE" + + if [ "$HTTP_CODE" -eq 200 ]; then + echo "✅ Smoke test passed. Status: HTTP $HTTP_CODE" + else + echo "❌ Smoke test failed. Status: HTTP $HTTP_CODE" + exit 1 + fi From a30eb4b01f31fa5d670a6d1dce0c707217edd394 Mon Sep 17 00:00:00 2001 From: chadrakdev Date: Sun, 24 May 2026 13:43:35 +0100 Subject: [PATCH 3/3] Add loop to check both Netlify and custom domains --- .github/workflows/deploy.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1a4037e..71a681e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -67,18 +67,24 @@ jobs: - name: Check site health shell: bash run: | - # Wait for deployment sleep 30 - URL="https://chadrak.dev/" + URLS=( + "https://chadrakdev.netlify.app/" + "https://chadrak.dev/" + ) - HTTP_CODE=$(curl -s --fail -o /dev/null -w "%{http_code}" "$URL") + for URL in "${URLS[@]}"; do + echo "Checking $URL" - echo "HTTP response code: $HTTP_CODE" + HTTP_CODE=$(curl -s --fail -o /dev/null -w "%{http_code}" "$URL") - if [ "$HTTP_CODE" -eq 200 ]; then - echo "✅ Smoke test passed. Status: HTTP $HTTP_CODE" - else - echo "❌ Smoke test failed. Status: HTTP $HTTP_CODE" - exit 1 - fi + echo "HTTP response code for $URL: $HTTP_CODE" + + if [ "$HTTP_CODE" -ne 200 ]; then + echo "❌ Smoke test failed for $URL (HTTP $HTTP_CODE)" + exit 1 + fi + done + + echo "✅ All smoke tests passed"