Skip to content

Commit

Permalink
Merge pull request #74 from PtPrashantTripathi/PtPrashantTripathi-pat…
Browse files Browse the repository at this point in the history
…ch-1

Update cd.yml
  • Loading branch information
PtPrashantTripathi authored Sep 24, 2024
2 parents eb57a58 + 75fb632 commit 56b4d87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,20 @@ jobs:
- name: Setup GitHub Pages
uses: actions/configure-pages@v5

# Step 2.5: Replace local API path with the live API URL in 'render.js'
# Step 3: Replace local API path with the live API URL in 'render.js'
- name: Update API Path in render.js
run: |
echo "Replacing local API path with live URL..."
sed -i 's|../DATA/API/API_data.json|https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/DATA/API/API_data.json|' ./FRONTEND/asset/js/render.js
# Step 3: Upload static site content from 'FRONTEND' directory as an artifact
# Step 4: Upload static site content from 'FRONTEND' directory as an artifact
- name: Upload static site content
uses: actions/upload-pages-artifact@v3
with:
path: './FRONTEND/' # Path to frontend static files
retention-days: 5 # Retain artifacts for 5 days

# Step 4: Deploy the uploaded artifact to GitHub Pages
# Step 5: Deploy the uploaded artifact to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# Step 5: Verify successful deployment (Optional)
- name: Verify deployment
run: |
DEPLOY_URL="${{ steps.deployment.outputs.page_url }}"
echo "Deployed site URL: $DEPLOY_URL"
curl -I $DEPLOY_URL | grep "200 OK" || echo "Warning: Deployment may have failed."
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
workflow_dispatch:

jobs:

update:
# Use the latest Ubuntu runner
runs-on: ubuntu-latest
Expand All @@ -18,7 +19,7 @@ jobs:
env:
RELEASE_DATE: "" # Placeholder for release date, set dynamically during the job
PROJECT_DIR: ${{ github.workspace }} # Set project directory to the current GitHub workspace

url: ${{ steps.cpr.outputs.pull-request-url }}
steps:
# Step 1: Checkout the repository
- name: Checkout repository
Expand Down

0 comments on commit 56b4d87

Please sign in to comment.