diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml new file mode 100644 index 00000000..d209dae3 --- /dev/null +++ b/.github/workflows/deploy-demo.yml @@ -0,0 +1,63 @@ +name: Deploy Demo to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +# Least-privilege permissions +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run +# in-progress and latest queued. Do not cancel in-progress runs. +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Assemble site + run: | + mkdir -p _site + cp demo/live_demo.html _site/index.html + cp dist/ulabel.min.js _site/ulabel.min.js + + - name: Configure Pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 + with: + path: _site + + deploy: + needs: build + 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@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/README.md b/README.md index b611f4c5..5264ce5c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A browser-based tool for annotating images. [Demo Gif](https://ulabel.s3.us-east-2.amazonaws.com/output.gif) -[Interactive Demo](https://ulabel.s3.us-east-2.amazonaws.com/live_demo.html) +[Interactive Demo](https://senterallc.github.io/ulabel/) ## Usage diff --git a/demo.js b/demo.js index 431e4063..c4e5dc0a 100644 --- a/demo.js +++ b/demo.js @@ -12,4 +12,5 @@ console.log(`http://localhost:${port}/multi-class.html`); console.log(`http://localhost:${port}/frames.html`); console.log(`http://localhost:${port}/box-roi.html`); console.log(`http://localhost:${port}/resume-from.html`); -console.log(`http://localhost:${port}/row-filtering-example.html`); \ No newline at end of file +console.log(`http://localhost:${port}/row-filtering-example.html`); +console.log(`http://localhost:${port}/live_demo.html`); \ No newline at end of file diff --git a/demo/live_demo.html b/demo/live_demo.html new file mode 100644 index 00000000..5f5aa3a4 --- /dev/null +++ b/demo/live_demo.html @@ -0,0 +1,92 @@ + + + + ULabel Interactive Demo + + + + + + + + + + + +
+ +