upgrade nodejs version #451
Workflow file for this run
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
--- | |
# ref: https://sli.dev/guide/hosting.html#github-pages | |
name: Deploy Slide | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
paths: | |
- '.github/workflows/deploy_slide.yaml' | |
- 'slide/**' | |
- '.prettierrc' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
formatter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# https://github.com/actions/setup-node/issues/206#issuecomment-774538395 | |
- uses: nodenv/actions/node-version@main | |
id: nodenv | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '${{ steps.nodenv.outputs.node-version }}' | |
- working-directory: slide | |
run: npm ci | |
- name: format check | |
working-directory: slide | |
run: npm run formatten && git diff --exit-code | |
slidev-build: | |
needs: formatter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# https://github.com/actions/setup-node/issues/206#issuecomment-774538395 | |
- uses: nodenv/actions/node-version@v3 | |
id: nodenv | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '${{ steps.nodenv.outputs.node-version }}' | |
- name: slidev build | |
working-directory: slide | |
run: | | |
npm ci | |
# https://sli.dev/guide/hosting.html#provide-downloadable-pdf | |
npm run build -- --base /${{ github.event.repository.name }}/ | |
npm run export | |
mv slides-export.pdf dist/flutter_expensive_native_embedding_journey.pdf | |
- uses: actions/configure-pages@v4 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './slide/dist/' | |
deploy-slide: | |
concurrency: | |
group: 'deploy-slide' | |
cancel-in-progress: true | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: slidev-build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/deploy-pages@v4 | |
id: deployment |