-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Added React Demo webApp and deployment workflow #73
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
Merged
Merged
Changes from 216 commits
Commits
Show all changes
238 commits
Select commit
Hold shift + click to select a range
a86a545
Update README title for BYU team branch
amur-bashirov c69f6ff
created React Demo
amur-bashirov e41f690
Amur's React + Vite default app
amur-bashirov 125eae9
Rename React app folder
amur-bashirov 6872ffb
Created folders to begin developing
Samuelsotogit d7c15cb
Merge branch 'BYU-Development' of https://github.com/Samuelsotogit/sy…
Samuelsotogit cd99b03
put react empty app into web-apps folder
amur-bashirov dd5b89e
Update Nimble package
reouct 0022308
Remove default React buttons
reouct f62b9bc
Added NI icon to the page
amur-bashirov 684e857
added buttons colors
amur-bashirov 91d5c64
Co-authored-by: Bowen Liu <[email protected]>
amur-bashirov 0a24153
new path and css
amur-bashirov 85d83b1
put a placeholder for config.js
amur-bashirov b1de94a
changed it to the typescript
amur-bashirov df1b8ce
put a placeholder for config
amur-bashirov 71bb8d2
unable to use secrets not in pipline, reversed the proccess back
amur-bashirov fa85069
pit config.ts into gitignore
amur-bashirov 51d0af9
tried to put it one more time
amur-bashirov 5a10fcc
changed config back
amur-bashirov dff043c
Stop tracking config.ts
amur-bashirov 9bc4478
push to delete config.ts
amur-bashirov 6b4de7c
deleted dem_config
amur-bashirov 9626c3b
finished creating demo config
amur-bashirov 07aca10
finished config file and demo config file
amur-bashirov 3fc1884
defined div for api call
amur-bashirov acef4c6
finished css for button and api
amur-bashirov 3084d50
defined first div and title for the example css
amur-bashirov a2c4e9d
Set Up README.md on top and lower levels within the repo
Samuelsotogit 5026d57
Merge branch 'BYU-Development' of https://github.com/Samuelsotogit/sy…
Samuelsotogit a2b111f
sussesfuly called api call
amur-bashirov 805acec
Update README on how to run the app locally.
reouct d4c1875
fixed most of the issues with main description for now
amur-bashirov e5da9fa
Merge branch 'Bowen-Amur-Design' of https://github.com/Samuelsotogit/…
amur-bashirov 4edeaad
CSS cleanup.
reouct 96316c1
Update on displaying the response on the screen
reouct 0824d32
Starting Blazor Work
Hecktomb200 b01f438
empty new blazor app
amur-bashirov 00f5936
added html
amur-bashirov 0e96f9b
renamed service to serviceProxy)
rockyRaccoon13 ef0e56f
dotnet changes
Samuelsotogit 6027eee
added gitignore
amur-bashirov 4d0c12f
Merge branch 'BYU-Development' into Bowen-Amur-Logan-Design
amur-bashirov ed6f6f1
ignore config (sensitive data) and node_modules (bloat)
rockyRaccoon13 cd37f3d
ignore node_modules, dist/, *.nipkg
rockyRaccoon13 614574b
fix(build) vite build now uses relative paths
rockyRaccoon13 29d2a33
fixed proxy setup. Add vite env files for dev and prod
rockyRaccoon13 7506bfa
update(README). proxy config and SL-CLI deployment instructions
rockyRaccoon13 c1bd8e7
Merge branch 'BYU-Development' into dev/benson
rockyRaccoon13 ab058fc
temp fix(proxyService) proxy works for specific endpoint and method
rockyRaccoon13 3ecb790
added notes on how dev/prod envs work
rockyRaccoon13 fe125a0
made service work for all methods and upstream paths
rockyRaccoon13 1e2a81e
Merge branch 'BYU-Development' into dev/benson
rockyRaccoon13 af1b8f5
Merge branch 'ni:main' into BYU-Development
rockyRaccoon13 b580e0c
added test
rockyRaccoon13 73453e1
updated css
amur-bashirov 53eab0a
changed the structure of the design
amur-bashirov 3da2929
imported font
amur-bashirov db4488d
Added Initial Blazor APP
Samuelsotogit a0b2bb9
Merge branch 'BYU-Development' of https://github.com/Samuelsotogit/sy…
Samuelsotogit 4b584d3
Changed file names
Samuelsotogit af084c0
added dependencies via npm
Samuelsotogit 610c690
Installed NimbleBlazor dependencies, created API component page with …
Samuelsotogit 417f71f
Add Nimble components support to Blazor app
Samuelsotogit b0ba768
Merge branch 'blazor-API-call-feature' into BYU-Development
Samuelsotogit 05adc20
fixed buttons and description css
amur-bashirov 36bebdd
init(webapp-deployment ci)
rockyRaccoon13 9ab6fc5
fixed webapp-deploy.yml to run action on change to yml
rockyRaccoon13 681689e
Add interactive API call example page
Samuelsotogit 80d3e06
figured out css for links
amur-bashirov 82ee280
fix(webapp-deploy.yml) - actions versions, app paths, secrets keys
rockyRaccoon13 30e500f
fix(webapp workflow) - add slcli to github path
rockyRaccoon13 eee214e
fix(webapp workflow) - update login to match new slcli cmd
rockyRaccoon13 94c52c2
change(webapp-deploy) add Prod prefix to published name
rockyRaccoon13 10964a7
change
rockyRaccoon13 fce4987
refactor(webb-app deploy) 1 job (instead of 2)
rockyRaccoon13 c6be905
Merge branch 'ni:main' into BYU-Development
rockyRaccoon13 cce3084
Merge branch 'ni:main' into main
rockyRaccoon13 4a2a712
added test
rockyRaccoon13 1280d33
init(webapp-deployment ci)
rockyRaccoon13 d828e1a
fixed webapp-deploy.yml to run action on change to yml
rockyRaccoon13 436c0be
fix(webapp-deploy.yml) - actions versions, app paths, secrets keys
rockyRaccoon13 140d829
fix(webapp workflow) - add slcli to github path
rockyRaccoon13 1dd7b16
fix(webapp workflow) - update login to match new slcli cmd
rockyRaccoon13 0230da8
change(webapp-deploy) add Prod prefix to published name
rockyRaccoon13 3334e6c
change
rockyRaccoon13 fce8ba1
refactor(webb-app deploy) 1 job (instead of 2)
rockyRaccoon13 df0d79d
delete(unused)
rockyRaccoon13 2de2578
setup esLint using NI rules (plus, downgraded globals to make lintin…
rockyRaccoon13 9f3ed3b
Merge branch 'BYU-Development' into dev/benson
rockyRaccoon13 88fe2f5
mod(vite.config.ts) eslint ignore(no-default-export, no-extra-dep)
rockyRaccoon13 089eb71
add lint to webapp-deploy workflow
rockyRaccoon13 02e7519
dotnet changes
Samuelsotogit b1201fd
Added Initial Blazor APP
Samuelsotogit adf8bc4
Changed file names
Samuelsotogit 883e029
Installed NimbleBlazor dependencies, created API component page with …
Samuelsotogit 3a36716
Add Nimble components support to Blazor app
Samuelsotogit 892f6c8
added test
rockyRaccoon13 858487d
init(webapp-deployment ci)
rockyRaccoon13 e4d1eb6
delete(unused)
rockyRaccoon13 0625fa0
setup esLint using NI rules (plus, downgraded globals to make lintin…
rockyRaccoon13 2b6cead
mod(vite.config.ts) eslint ignore(no-default-export, no-extra-dep)
rockyRaccoon13 c4ae11d
add lint to webapp-deploy workflow
rockyRaccoon13 71b963b
init(deployDev.sh) to automate adding webapp to SL website
rockyRaccoon13 da59ef1
Merge branch 'BYU-Development'
rockyRaccoon13 f1c33a7
addTo(webapp deployment workflow) run on angular folders
rockyRaccoon13 25eedc8
Merge branch 'BYU-Development'
rockyRaccoon13 5d00908
fix(env variable for apps dir react)
rockyRaccoon13 386de8e
Merge branch 'BYU-Development'
rockyRaccoon13 cb2fae3
changed the colors and some ui
amur-bashirov 5b1f6f0
API call now functioning for local development
Samuelsotogit 3f41680
fix(workflow) delete incorrect white space
rockyRaccoon13 569b283
Merge branch 'blazor-API-call-feature' into BYU-Development
Samuelsotogit ea2bfcf
saved fonts offline
amur-bashirov 4471f7b
Merge branch 'main' of https://github.com/Samuelsotogit/systemlink-en…
reouct bccf25c
changed all the links to open tabs
amur-bashirov c72cdcd
Merge branch 'React'
amur-bashirov 0afb87a
fix(workflow) fix typo in angular env variable
rockyRaccoon13 6e5888b
Merge branch 'devOps/CI_CD'
rockyRaccoon13 8087555
mv(serviceProxy) to Dev Tools/ApiServiceProxy
rockyRaccoon13 3aa315b
rename(amur-react-vite-app) to ApiKeyAuthApp
rockyRaccoon13 195361b
mv web_apps/** into examples/
rockyRaccoon13 9c9263e
update(workflow) to reflect path changes
rockyRaccoon13 c4389ee
implemented Nimble fonts
amur-bashirov bdc82b0
implemented Nimble fonts
amur-bashirov e203c5c
Merge branch 'main' into React -- restructured code
rockyRaccoon13 4e73c76
deleted Blazor apps
amur-bashirov c46a04e
deleted react workflow
amur-bashirov 2b4e599
implemented Nimble fonts
amur-bashirov d65631e
edited Instructions. for running proxy server
rockyRaccoon13 694df61
edited Instructions. for running proxy server
rockyRaccoon13 1be8f3c
add webapp_deploy
rockyRaccoon13 032ae88
fix (workflow) app dirs
rockyRaccoon13 8fb5d11
fixed workflow target path
rockyRaccoon13 6006bac
rm(junk Readme_files folder)
rockyRaccoon13 f737b36
added green box border
amur-bashirov 057cea9
edit(README) edit web_app examples
rockyRaccoon13 f8a6374
added green box border
amur-bashirov 8090b68
Merge branch 'main' into React
rockyRaccoon13 9dc7710
added padding
amur-bashirov af2732f
changed the titles for the links
amur-bashirov c22cbb3
changed all the divs inside the header to make the tabs as links them…
amur-bashirov 3611ec8
renamed title component to make css easier to work with
amur-bashirov e6ca6f7
polished design for links
amur-bashirov f62fceb
added logos folder
amur-bashirov adc2147
clean up(bad files)
rockyRaccoon13 bdfdfa2
remove react logo
rockyRaccoon13 44a7753
delete font files
rockyRaccoon13 fd194aa
Merge remote-tracking branch 'origin/NewReact' into React
rockyRaccoon13 2550523
Update README.md edit letter casing
rockyRaccoon13 500e5d7
Update .gitignore -- removed .net ignores
rockyRaccoon13 26ec764
change web app folder names to match casing
rockyRaccoon13 7528064
move .gitignore to parent folder (1 per project)
rockyRaccoon13 d65a7dc
Update .github/workflows/webapp-deploy.yml
rockyRaccoon13 072561b
fixed eslint config (app ts/tsx, js, and vite errors)
rockyRaccoon13 93cd548
fix basic linting errors
rockyRaccoon13 fedfca4
fixed eslint config (app ts/tsx, js, and vite errors)
rockyRaccoon13 6295d5d
fix basic linting errors
rockyRaccoon13 ee663e5
changed term website to env to refer to SL UI env
rockyRaccoon13 31cfc8d
change package.json meta
rockyRaccoon13 60dd345
updated readme for service proxy
rockyRaccoon13 f22045e
added scss file
amur-bashirov b275354
sussessfuly transitioned all the files to scc file and imported nimbl…
amur-bashirov 8e95274
merge css-> scss changes
amur-bashirov 4ff4719
change css -> scss import
amur-bashirov f5b3dc9
solved lint issue with logging
amur-bashirov a6529f4
made lint to ignore dist folder
amur-bashirov 6cd3b25
finished lint problems
amur-bashirov 275b689
update webapp workflow triggers and cancel on concurrent triggers
rockyRaccoon13 06a0c28
Merge branch 'devOps/CI_CD' into prUpdate
rockyRaccoon13 a8ff6e2
polisehd scss file
amur-bashirov 293f82f
Merge branch 'devOps/CI_CD' of https://github.com/Samuelsotogit/syste…
amur-bashirov 3dd6cd4
polisehd final version of scss
amur-bashirov ba4121b
fix package-lock
rockyRaccoon13 86f63f2
Merge branch 'devOps/CI_CD' of https://github.com/Samuelsotogit/syste…
amur-bashirov 8da5720
fix lint
rockyRaccoon13 89574c7
separate build and package jobs
rockyRaccoon13 29bce5f
Merge branch 'devOps/CI_CD' into NewReact
rockyRaccoon13 4b4f206
fix formatting errors with lint:fix
rockyRaccoon13 b986b07
Revert "separate build and package jobs"
rockyRaccoon13 b036324
fix workflow target to run on changes to the workflow files
rockyRaccoon13 59c2d7d
add blazor functionality to pipeline
rockyRaccoon13 82d80b6
make artifact/deployment only happen on ni/main repo/branch
rockyRaccoon13 e31ddfc
separate build and deploy steps
rockyRaccoon13 e4f5b3a
add caching of runtimes and slcli between job runners
rockyRaccoon13 9b0b325
fix caches for runtimes
rockyRaccoon13 8aa267d
add comments to workflow
rockyRaccoon13 7604bd8
fixed scss file
amur-bashirov 091b7c3
Merge remote-tracking branch 'upstream/main' into devOps/CI_CD
rockyRaccoon13 b7d4b51
add eslint to apiProxy
rockyRaccoon13 f919c3c
fix formatting and return issues found via lint
rockyRaccoon13 9125c37
ignore eslint no-console for proxy error msgs
rockyRaccoon13 b03b01d
add workflow to lint apiProxy
rockyRaccoon13 9148e77
add Readme ro "Framework Examples/Dev Tools"
rockyRaccoon13 93aba64
change api and github links
rockyRaccoon13 4ca4819
add start script
rockyRaccoon13 3f8c4fa
fix local import
rockyRaccoon13 e92b924
fix lint formatting
rockyRaccoon13 bc9f34f
remove commented icon
rockyRaccoon13 534ae45
make deploy script work for any dist/ and workspace
rockyRaccoon13 627ad5c
rename deployment script
rockyRaccoon13 48eae21
mv deploy script to dev tools
rockyRaccoon13 0f2ccad
add check for slcli installation
rockyRaccoon13 7ebaeae
solved spacing issue
amur-bashirov 5f882e5
Merge branch 'devOps/CI_CD' of https://github.com/Samuelsotogit/syste…
amur-bashirov 991e49b
rm unused code
rockyRaccoon13 1cf6ed9
update dev notes
rockyRaccoon13 9a45540
move dev notes to dev Tools
rockyRaccoon13 387efe4
Merge remote-tracking branch 'origin/devOps/CI_CD' into devOps/CI_CD
rockyRaccoon13 c951819
add run script to README
rockyRaccoon13 9949a3d
refactor webapp-deploy into separate node and blazor build jobs.
rockyRaccoon13 193cbd0
add readme for deploy DistToSl.sh
rockyRaccoon13 149943a
add comment about default dist
rockyRaccoon13 93a55e9
add smoke test to proxy workflow
rockyRaccoon13 3528732
Add Node eslint rules to fix lint error
jattasNI a0b7c39
Ignore proxyConfig.js from linting
jattasNI 95b600f
installed dependency for sans pro
amur-bashirov 03ed55a
changed the link to the repository to refence the exact folder for th…
amur-bashirov 27641b8
Add desc of webApp dev tools
rockyRaccoon13 e8de274
Add WebApp/Frameworks README
rockyRaccoon13 b5f8e0d
edit framework readme
rockyRaccoon13 850b358
remove blazor from workflow
rockyRaccoon13 cc75ce5
remove junk from framework readme
rockyRaccoon13 c657504
create readme for react web apps
rockyRaccoon13 03e3427
Fix README link
jattasNI 38514d9
README edits
jattasNI e8c37b6
Align README with #83
jattasNI 701b51b
Rename Web Applications to Web Apps
jattasNI 9bce1a8
Fix links from rename
jattasNI 7a4a297
More README edits
jattasNI 03a016b
Simplify gitignores
jattasNI 9a317b2
SCSS formatting
jattasNI f9a143f
typos
jattasNI c63ceaa
Use more Nimble tokens
jattasNI 3ee78f2
Nimble font tokens
jattasNI 7082a0e
Title layout
jattasNI 3f99b5b
padding
jattasNI 7e5529e
Use Nimble fonts
jattasNI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| name: API Proxy Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "examples/Web Applications/Dev Tools/ApiServiceProxy" | ||
| - ".github/workflows/api-proxy-lint.yml" | ||
| push: | ||
| branches: | ||
| - "**" | ||
| paths: | ||
| - "examples/Web Applications/Dev Tools/ApiServiceProxy" | ||
| - ".github/workflows/api-proxy-lint.yml" | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: "examples/Web Applications/Dev Tools/ApiServiceProxy" | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up proxy config | ||
| run: cp proxyConfig.example.js proxyConfig.js | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Lint code | ||
| run: npm run lint | ||
|
|
||
| - name: Start server (smoke test) | ||
| run: | | ||
| node ./index.js & | ||
| sleep 3 | ||
| kill $! |
|
rockyRaccoon13 marked this conversation as resolved.
|
This file contains hidden or 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,305 @@ | ||
| name: Deploy WebApps (All frameworks) | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "examples/Web Applications/Framework Examples/**" | ||
| - ".github/workflows/webapp-deploy.yml" | ||
| push: | ||
| branches: | ||
| - "**" | ||
| paths: | ||
| - "examples/Web Applications/Framework Examples/**" | ||
| - ".github/workflows/webapp-deploy.yml" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| generate-node-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Generate Node apps matrix | ||
| id: set-matrix | ||
| run: | | ||
| BASE_DIR="examples/Web Applications/Framework Examples" | ||
| APPS=() | ||
|
|
||
| for framework_dir in "$BASE_DIR"/*; do | ||
| if [ -d "$framework_dir" ]; then | ||
| FRAMEWORK="$(basename "$framework_dir")" | ||
| if [[ "$FRAMEWORK" == "Blazor" ]]; then | ||
| continue | ||
| fi | ||
| for app_dir in "$framework_dir"/*; do | ||
| if [ -d "$app_dir" ]; then | ||
| APPS+=("$FRAMEWORK/$(basename "$app_dir")") | ||
| fi | ||
| done | ||
| fi | ||
| done | ||
|
|
||
| MATRIX_JSON=$(printf '%s\n' "${APPS[@]}" | jq -R . | jq -cs .) | ||
| echo "matrix=$MATRIX_JSON" >> "$GITHUB_OUTPUT" | ||
| echo "Generated Node matrix: $MATRIX_JSON" | ||
|
|
||
| generate-blazor-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Generate Blazor apps matrix | ||
| id: set-matrix | ||
| run: | | ||
| BASE_DIR="examples/Web Applications/Framework Examples" | ||
| APPS=() | ||
|
|
||
| for framework_dir in "$BASE_DIR"/*; do | ||
| if [ -d "$framework_dir" ]; then | ||
| FRAMEWORK="$(basename "$framework_dir")" | ||
| if [[ "$FRAMEWORK" != "Blazor" ]]; then | ||
| continue | ||
| fi | ||
| for app_dir in "$framework_dir"/*; do | ||
| if [ -d "$app_dir" ]; then | ||
| APPS+=("$FRAMEWORK/$(basename "$app_dir")") | ||
| fi | ||
| done | ||
| fi | ||
| done | ||
|
|
||
| MATRIX_JSON=$(printf '%s\n' "${APPS[@]}" | jq -R . | jq -cs .) | ||
| echo "matrix=$MATRIX_JSON" >> "$GITHUB_OUTPUT" | ||
| echo "Generated Blazor matrix: $MATRIX_JSON" | ||
|
|
||
| build-node: | ||
| needs: generate-node-matrix | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| app_dir: ${{ fromJSON(needs.generate-node-matrix.outputs.matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Parse Node app | ||
| run: | | ||
| APP_DIR="examples/Web Applications/Framework Examples/${{ matrix.app_dir }}" | ||
| APP_NAME="$(basename "$APP_DIR")" | ||
| echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV | ||
| echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24.x | ||
|
|
||
| - name: Install Node dependencies | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: npm ci | ||
|
|
||
| - name: Lint Node app | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: npm run lint | ||
|
|
||
| - name: Build Node app | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: npm run build | ||
|
|
||
| - name: Prepare Node build folder | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| mkdir -p build | ||
| if [ -d dist ]; then mv dist/* build/; fi | ||
|
|
||
| - name: Upload Node build artifact | ||
| uses: actions/upload-artifact@v6 | ||
| if: | ||
| github.repository_owner == 'ni' && startsWith(github.ref, | ||
| 'refs/heads/main') | ||
| with: | ||
| name: ${{ env.APP_NAME }}-build | ||
| path: ${{ env.APP_DIR }}/build | ||
|
|
||
| build-blazor: | ||
| needs: generate-blazor-matrix | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| app_dir: ${{ fromJSON(needs.generate-blazor-matrix.outputs.matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Parse Blazor app | ||
| run: | | ||
| APP_DIR="examples/Web Applications/Framework Examples/${{ matrix.app_dir }}" | ||
| APP_NAME="$(basename "$APP_DIR")" | ||
| echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV | ||
| echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@v3 | ||
| with: | ||
| dotnet-version: 10.0 | ||
|
|
||
| - name: Restore Blazor dependencies | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: dotnet restore | ||
|
|
||
| - name: Publish Blazor app | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: dotnet publish *.csproj -o dist | ||
|
|
||
| - name: Copy fingerprinted dotnet.js | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| MANIFEST=$(find dist -maxdepth 1 -name "*.staticwebassets.endpoints.json" | head -1) | ||
| DOTNET_JS=$(grep -o '"Route":"_framework/dotnet\.js","AssetFile":"_framework/[^"]*\.js"' "$MANIFEST" \ | ||
| | grep -v '\.js\.br"' | grep -v '\.js\.gz"' | head -1 \ | ||
| | sed 's/.*"AssetFile":"_framework\/\(.*\)"/\1/') | ||
| cp "dist/wwwroot/_framework/$DOTNET_JS" "dist/wwwroot/_framework/dotnet.js" | ||
|
|
||
| - name: Prepare Blazor build folder | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| mkdir -p build | ||
| mv dist/wwwroot/* build/ | ||
|
|
||
| - name: Upload Blazor build artifact | ||
| uses: actions/upload-artifact@v6 | ||
| if: | ||
| github.repository_owner == 'ni' && startsWith(github.ref, | ||
| 'refs/heads/main') | ||
| with: | ||
| name: ${{ env.APP_NAME }}-build | ||
| path: ${{ env.APP_DIR }}/build | ||
|
|
||
| cache-slcli: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| cache-key: slcli-homebrew | ||
| steps: | ||
| - name: Restore Homebrew cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: /home/linuxbrew/.linuxbrew | ||
| key: brew-cache-${{ runner.os }}-slcli | ||
|
|
||
| - name: Ensure slcli is installed | ||
| run: | | ||
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
| brew tap ni-kismet/homebrew-ni | ||
| if ! command -v slcli &>/dev/null; then | ||
| brew install slcli | ||
| fi | ||
| echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Verify slcli | ||
| run: slcli --version | ||
|
|
||
| generate-combined-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Generate app matrix | ||
| id: set-matrix | ||
| run: | | ||
| BASE_DIR="examples/Web Applications/Framework Examples" | ||
| APPS=() | ||
|
|
||
| for framework_dir in "$BASE_DIR"/*; do | ||
| if [ -d "$framework_dir" ]; then | ||
| FRAMEWORK="$(basename "$framework_dir")" | ||
| for app_dir in "$framework_dir"/*; do | ||
| if [ -d "$app_dir" ]; then | ||
| APP_NAME="$(basename "$app_dir")" | ||
| APPS+=("$FRAMEWORK/$APP_NAME") | ||
| fi | ||
| done | ||
| fi | ||
| done | ||
|
|
||
| # Compact JSON (single line) | ||
| JSON_MATRIX=$(printf '%s\n' "${APPS[@]}" | jq -R . | jq -cs .) | ||
|
|
||
| echo "matrix=$JSON_MATRIX" >> "$GITHUB_OUTPUT" | ||
|
|
||
| package-deploy: | ||
| if: | ||
| github.repository_owner == 'ni' && startsWith(github.ref, | ||
| 'refs/heads/main') | ||
| needs: [build-node, build-blazor, cache-slcli, generate-combined-matrix] | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| app_dir: ${{ fromJSON(needs.generate-combined-matrix.outputs.matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Parse app | ||
| run: | | ||
| APP_DIR="examples/Web Applications/Framework Examples/${{ matrix.app_dir }}" | ||
| APP_NAME="$(basename "$APP_DIR")" | ||
| echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV | ||
| echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV | ||
|
|
||
| - name: Create build folder | ||
| run: mkdir -p "${{ env.APP_DIR }}/build" | ||
|
|
||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: ${{ env.APP_NAME }}-build | ||
| path: "${{ env.APP_DIR }}/build" | ||
|
|
||
| - name: Restore Homebrew-slcli from cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: /home/linuxbrew/.linuxbrew | ||
| key: brew-cache-${{ runner.os }}-slcli | ||
|
|
||
| - name: Add slcli to PATH | ||
| run: echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Package into .nipkg | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: slcli webapp pack build/ --output "${{ env.APP_NAME }}.nipkg" | ||
|
|
||
| - name: Upload .nipkg artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: ${{ env.APP_NAME }}.nipkg | ||
| path: "${{ env.APP_DIR}}/${{ env.APP_NAME }}.nipkg" | ||
|
|
||
| - name: Login to SystemLink | ||
| run: | | ||
| slcli login --profile ghActions --url "${{ secrets.SL_API_URL }}" \ | ||
| --api-key "${{ secrets.SL_API_KEY }}" \ | ||
| --web-url "${{ secrets.SL_WEBSITE_URL }}" \ | ||
| --workspace "${{ secrets.SL_WORKSPACE }}" | ||
|
|
||
| - name: Deploy webapp to SystemLink | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| pkg="${{ env.APP_NAME }}.nipkg" | ||
| WEBAPP_NAME="${{ env.APP_NAME }}_PROD" | ||
| WEBAPP_ID=$(slcli webapp list --workspace "${{ secrets.SL_WORKSPACE }}" --filter "$WEBAPP_NAME" --format json | jq -r '.[0].id // empty') | ||
|
|
||
| if [[ -z "$WEBAPP_ID" ]]; then | ||
| echo " * Webapp does not exist -- publishing new" | ||
| slcli webapp publish "$pkg" --name "$WEBAPP_NAME" --workspace "${{ secrets.SL_WORKSPACE }}" | ||
| else | ||
| echo " * Webapp exists -- updating" | ||
| slcli webapp publish "$pkg" --id "$WEBAPP_ID" | ||
| fi | ||
| echo "**Deployed $WEBAPP_NAME**" |
This file contains hidden or 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
2 changes: 2 additions & 0 deletions
2
examples/Web Applications/Dev Tools/ApiServiceProxy/.gitignore
This file contains hidden or 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,2 @@ | ||
| proxyConfig.js | ||
| node_modules/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.