Skip to content

deploy-exb-apps.yml

deploy-exb-apps.yml #1

name: Deploy Experience Builder Apps
on:
push:
branches:
- master
jobs:
Deploy-Experience-Builder-Apps:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Download Experience Builder
run: npx arcgis-lib-downloader -p arcgis-experience-builder -v 1.13 -t Download
env:
ARCGIS_LIB_DOWNLOADER_USERNAME: ${{ secrets.ARCGIS_LIB_DOWNLOADER_USERNAME }}
ARCGIS_LIB_DOWNLOADER_PASSWORD: ${{ secrets.ARCGIS_LIB_DOWNLOADER_PASSWORD }}
- name: Unzip Experience Builder
run: unzip -q arcgis-experience-builder-1.13.zip -d arcgis-experience-builder-1.13
- name: Copy Custom Widgets
run: cp -r widgets/* arcgis-experience-builder-1.13/ArcGISExperienceBuilder/client/your-extensions/widgets
- name: Install Custom Widgets dependencies
run: node npm-install-subfolders.js
- name: Create App directory
run: mkdir public && cd public && mkdir apps && cd apps
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/server
- name: Copy apps
run: cp -r apps/* arcgis-experience-builder-1.13/ArcGISExperienceBuilder/server/public/apps
- name: NPM install client folder
run: npm ci
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/client
- name: NPM install in server folder
run: npm ci
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/server
- name: Build widgets
run: npm run build:prod
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/client
- name: Run download script
run: node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('2', 'app.zip')"
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder
env:
NODE_ENV: production
- name: Unzip app zip
# ExB has non-standard file permissions so use chmod after unzip
run: |
unzip -q app.zip -d app
chmod -R 777 app
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder
- name: Generate screenshot (optional)
working-directory: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/app
continue-on-error: true
run: |
npm install --global pageres-cli
npm install --global serve
echo "{\"trailingSlash\":true}" > serve.json
serve . -p 5000 &
pageres http://localhost:5000/index.html 1024x768 --filename=screenshot --delay=10
- name: Deploy app zip to GH Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: arcgis-experience-builder-1.13/ArcGISExperienceBuilder/app