-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
929b7c7
commit ae0d1bb
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |