From b016e5a8da3f1fb18ee272620abaf638d3a481ea Mon Sep 17 00:00:00 2001 From: Muffin Date: Fri, 15 Mar 2024 22:05:27 -0500 Subject: [PATCH] Update GitHub Actions --- .github/workflows/deploy.yml | 50 +++++++++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 21 ++++++++------- 2 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..89fdce187 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +name: Deploy playground + +on: + workflow_dispatch: + push: + branches: [develop] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "deploy" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - name: Install dependencies + run: npm ci + - name: Build playground + run: npm run build + - name: Build docs + run: npm run docs + # We expect to see syntax errors from the old jsdoc cli not understanding some of our syntax + # It will still generate what it can, so it's safe to ignore the error + continue-on-error: true + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./playground/ + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cbbb9aac1..ea853b4f6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,4 +1,4 @@ -name: Node.js CI +name: CI on: push: @@ -7,13 +7,14 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - - run: npm ci - - run: npm run build - - run: npm test + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run lint + - run: npm run build + - run: npm run test