test deployment #2
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: Demo Deployment | |
on: | |
push: | |
branches: | |
- main | |
- 'gcweb-pr*' | |
- demo-deploy | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js with the correct version (Node.js 18 includes npm 10) | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
# Step 3: Install Bower (required for wet-boew dependencies) | |
- name: Install Bower | |
run: npm install -g bower | |
# Step 4: Install dependencies using --legacy-peer-deps to avoid conflicts | |
- name: Install dependencies | |
run: npm install --legacy-peer-deps | |
# Step 5: Build the demo files using npm | |
- name: Build Demo Files | |
run: npm run build | |
# Step 6: Copy built files to a temporary directory for deployment | |
- name: Copy Built Files | |
run: | | |
mkdir -p demo_files | |
cp -R dist/* demo_files/ | |
# Step 7: Deploy to gh-pages branch | |
- name: Deploy Demo | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_PAT }} | |
publish_dir: ./demo_files | |
publish_branch: gh-pages | |
user_name: 'GitHub Actions' | |
user_email: '[email protected]' |