Skip to content

feat: add pageloadsuccess and pageloaderror events (#13) #3

feat: add pageloadsuccess and pageloaderror events (#13)

feat: add pageloadsuccess and pageloaderror events (#13) #3

name: build-demo-page
on:
push:
branches: 'main'
jobs:
build_demo:
runs-on: ubuntu-latest
if: github.repository == 'gtm-nayan/svelte-pdfjs'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: build
env:
BASE_PATH: '/svelte-pdfjs'
run: |
pnpm build
touch build/.nojekyll
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v1
with:
path: "build/"
deploy:
# Add a dependency to the build job
needs: build_demo
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1