ci: add CI job to build demo. #1
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
name: Deploy Demo (dev) | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
jobs: | ||
build: | ||
name: Build Demo | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- name: Setup node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20.12.2 | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build app | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
run: npm run build | ||
# TODO: figure out why this separate step is necessary | ||
- run: | | ||
cp -r public/* dist/public/ | ||
echo '{ | ||
"oauthClientId": "https://zicklag.github.io/oauth-clients/pigeon-demo.json", | ||
"defaultHomeserver": 0, | ||
"homeserverList": ["pigeon"], | ||
"allowCustomHomeservers": false, | ||
"featuredCommunities": { | ||
"openAsDefault": false | ||
}, | ||
"hashRouter": { | ||
"enabled": false, | ||
"basename": "/" | ||
} | ||
}' > dist/config.json | ||
- name: Upload static files as artifact | ||
id: deployment | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: dist/ | ||
deploy: | ||
needs: build | ||
name: Deploy Demo | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |