Deploy to GH Pages #2
Workflow file for this run
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 to GH Pages | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
NODE_VERSION: '20' | |
jobs: | |
build: | |
name: Build app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Install dependencies and build | |
env: | |
APP_RELEASE: 'EBP Dev Release' | |
run: | | |
npm ci | |
npm run build-dev-ebp | |
cp ./dist/browser/index.html ./dist/browser/404.html | |
- name: Create CNAME file for custom domain | |
run: echo 'dev.geo.zh.ch' > ./dist/browser/CNAME | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist/browser | |
deploy: | |
name: Deploy to GH pages | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |