Skip to content

Commit

Permalink
Develop branch prebuilt frontend bundle (#1576) (#1577)
Browse files Browse the repository at this point in the history
* add prebuild github actions

* fix after testing

* add develop on run

* per fred

* per Fred

* per Fred
  • Loading branch information
dinhlongviolin1 authored Jul 25, 2024
1 parent 929b7c7 commit ae0d1bb
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Generate prebuild for develop branch

on:
push:
branches: [develop]
workflow_dispatch:

permissions:
contents: write

env:
NODE_OPTIONS: --max-old-space-size=4096

jobs:
reset-prebuild:
runs-on: ubuntu-latest
steps:
- name: Reset prebuild branch to develop
uses: nicksnell/action-reset-repo@master
with:
base_branch: develop
reset_branch: prebuild

prebuild:
needs: reset-prebuild
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: develop

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Hash frontend source code
id: hash-frontend
run: |
python tools/frontend/hash_source.py
echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
rm hash.txt
shell: bash

- name: Restore cached frontend build
id: cache-fe-build
uses: actions/cache@v4
with:
path: |
taipy/gui/webapp
taipy/gui_core/lib
key: frontend-build-${{ runner.os }}-${{ steps.hash-frontend.outputs.HASH }}

- name: Setup node
if: steps.cache-fe-build.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "**/package-lock.json"

- name: Frontend Bundle Build
if: steps.cache-fe-build.outputs.cache-hit != 'true'
run: python tools/frontend/bundle_build.py

- name: Reset npm dependencies
if: steps.cache-fe-build.outputs.cache-hit != 'true'
run: |
git checkout -- frontend/taipy/package.json
git checkout -- frontend/taipy/package-lock.json
git checkout -- frontend/taipy-gui/package-lock.json
- name: Add frontend build force to bypass gitignore
run: |
git add -f taipy/gui/webapp
git add -f taipy/gui_core/lib
- name: Commit prebuild changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: prebuild
add_options: "-u"
push_options: "--force"

0 comments on commit ae0d1bb

Please sign in to comment.