Skip to content

Commit

Permalink
Updated Nov 23 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiangyuan Li authored and Jiangyuan Li committed Nov 23, 2024
1 parent 19df68e commit 7755cb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Frozen Flask to GitHub Pages
name: Deploy Flask to GitHub Pages

on:
push:
Expand Down Expand Up @@ -26,15 +26,14 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 4: Freeze the Flask app
# Step 4: Run flask freeze
- name: Freeze Flask App
env:
FLASK_APP: app.py
run: flask freeze
run: |
python freeze.py # Run freeze.py to generate static files
# Step 5: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # Replace with output folder from freezing
publish_dir: ./ # Publish from the root directory (where freeze.py generates files)
7 changes: 7 additions & 0 deletions freeze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from app import app # Import your Flask app from app.py
from flask_frozen import Freezer

freezer = Freezer(app)

if __name__ == '__main__':
freezer.freeze() # This will generate the static files

0 comments on commit 7755cb3

Please sign in to comment.