Skip to content

Commit

Permalink
Add new GitHub Action for test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thera2002 committed Nov 4, 2024
1 parent 3235fa1 commit 567dac4
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/02-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Deploy OpenLIME Examples

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Permette di eseguire manualmente il workflow
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build library
run: npm run rollup

- name: Setup and start web server
run: |
# Installa un server web leggero
npm install -g http-server
# Avvia il server in background dalla directory dist
nohup npx http-server ./dist -p 8080 &
# Aspetta che il server sia pronto
sleep 5
# Verifica che il server sia attivo
curl http://localhost:8080 || exit 1
# Optional: deploy to GitHub Pages
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit 567dac4

Please sign in to comment.