Skip to content

Commit

Permalink
Update python-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AnubhavChaturvedi-GitHub authored Oct 30, 2024
1 parent dc67bf7 commit 90258bc
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Web Build + Deployment to GitHub Pages

on:
# Runs on push to any of the below branches
# Runs on push to the main or master branches
push:
branches:
- master
Expand All @@ -11,32 +11,26 @@ on:
branches:
- master
- main

# Allows you to run this workflow manually from the Actions tab of the repository
# Allows manual trigger from the Actions tab
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

env:
# https://flet.dev/docs/publish#versioning
BUILD_NUMBER: 1
BUILD_VERSION: 1.0.0
PYTHON_VERSION: 3.12.2
FLUTTER_VERSION: 3.24.0
PYTHON_VERSION: 3.9 # Use a compatible Python version for Flask and Frozen-Flask

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v2

- name: Setup Python ${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -45,31 +39,37 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install Frozen-Flask
- name: Generate static files with Frozen-Flask
run: |
python app.py # Assuming `freezer.freeze()` is in app.py and generates files in `build/`
- name: Upload static files for deployment
uses: actions/upload-pages-artifact@v1
with:
path: ./build # Directory containing the static files

deploy:
needs: build # wait for the "build" job to get done before executing this "deploy" job
needs: build # Run only after the "build" job completes

runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
pages: write # Required to deploy to Pages
id-token: write # Needed to verify the deployment source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@v2

- name: Deploy to GitHub Pages 🚀
if: github.event_name == 'push' # deploy only on push
id: deployment
uses: actions/deploy-pages@v4.0.5
uses: actions/deploy-pages@v1
with:
artifact_name: web-build-artifact
artifact_name: page-build-artifact

0 comments on commit 90258bc

Please sign in to comment.