apparently there's no v4 of actions/upload-pages-artifact #3
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
on: | |
push: | |
branches: | |
- main | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: yarn install | |
working-directory: math-blocks | |
run: yarn install | |
- name: yarn build-tsc | |
working-directory: math-blocks | |
run: yarn build-tsc | |
- name: yarn typedoc | |
working-directory: math-blocks | |
run: yarn typedoc | |
- name: Upload Docs artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs/ | |
name: docs | |
build: | |
needs: docs | |
permissions: | |
actions: read # to access artifacts from the build job | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node_modules- | |
- name: yarn install | |
run: yarn install --frozen-lockfile | |
- name: yarn build | |
run: yarn build | |
- name: download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: ./dist/docs | |
- name: Upload Page Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist/ | |
deploy: | |
needs: build | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
actions: read # to access artifacts from the build job | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |