From f1e59582b987e0c80dd64bb7d170c464f7604635 Mon Sep 17 00:00:00 2001 From: Paul Pestov <10750176+paulpestov@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:08:37 +0200 Subject: [PATCH] ci: add GH Pages workflow --- .github/workflows/{ci.js.yml => ci.yml} | 0 .github/workflows/gh-pages.yml | 41 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+) rename .github/workflows/{ci.js.yml => ci.yml} (100%) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/ci.js.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.js.yml rename to .github/workflows/ci.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..387f8edd --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,41 @@ +name: GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci + - run: npm run build + - run: mkdir -p ./examples + - run: cp -r dist/ examples/dist + + - name: deploy + uses: peaceiris/actions-gh-pages@v4 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./examples