feat: workflows #1
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: Build & Deploy | |
on: | |
push: | |
branches: ["master"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: latest | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Build Docs | |
run: pnpm run build:docs | |
- name: Copy files | |
run: | | |
cp LICENSE docs/LICENSE.txt | |
cp -r src docs/src | |
cp -r dist docs/dist | |
- name: Create Indexes | |
uses: Exponential-Workload/create-index-action@master | |
with: | |
dir: 'docs' | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'docs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |