Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New #76

Merged
merged 13 commits into from
Sep 25, 2024
14 changes: 3 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- main
paths:
- 'FRONTEND/**'
- '.github/workflows/**'

# Allow manual trigger from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -45,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."
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ on:
workflow_dispatch:

jobs:

update:
# Use the latest Ubuntu runner
runs-on: ubuntu-latest

# Define environment variables
env:
name: python
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 Expand Up @@ -60,7 +62,7 @@ jobs:
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
base: main # Create the PR against the main branch
base: ${{ github.ref_name }} # Create the PR against the main branch
branch: data-update # Create a new branch for the updates
delete-branch: true # Delete the branch after the PR is merged
title: "[PanditBot] Updating Repo Data ${{ env.RELEASE_DATE }}"
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ permissions:

jobs:
deploy:
# Environment configuration for GitHub Pages deployment
environment:
name: python
url: https://pypi.org/p/PortfolioTracker

# Use the latest stable Ubuntu runner
runs-on: ubuntu-latest

steps:
Expand All @@ -37,8 +42,8 @@ jobs:
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ eggs/
lib/
lib64/
parts/
sdist/
dist/
var/
wheels/
share/python-wheels/
Expand Down
Loading
Loading