Advertisement
Guest User

Untitled

a guest
Sep 7th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.75 KB | None | 0 0
  1. # Simple workflow for deploying static content to GitHub Pages
  2. name: deploy
  3.  
  4. on:
  5.  # Runs on pushes targeting the default branch
  6.   push:
  7.     branches: ['main']
  8.  
  9.   # Allows you to run this workflow manually from the Actions tab
  10.   workflow_dispatch:
  11. # Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
  12. permissions:
  13.   contents: read
  14.   pages: write
  15.   id-token: write
  16.  
  17. # Allow one concurrent deployment
  18. concurrency:
  19.   group: 'pages'
  20.   cancel-in-progress: true
  21.  
  22. jobs:
  23.   deploy:
  24.     environment:
  25.       name: github-pages
  26.       url: ${{ steps.deployment.outputs.page_url }}
  27.     runs-on: ubuntu-latest
  28.     steps:
  29.       - name: Checkout
  30.         uses: actions/checkout@v3
  31.       - uses: pnpm/action-setup@v2
  32.         name: Install pnpm
  33.         id: pnpm-install
  34.         with:
  35.           version: latest
  36.           run_install: false
  37.  
  38.       - name: Get pnpm store directory
  39.         id: pnpm-cache
  40.         shell: bash
  41.         run: |
  42.          echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
  43.  
  44.       - uses: actions/cache@v3.2.2
  45.         name: Setup pnpm cache
  46.         with:
  47.           path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
  48.           key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  49.           restore-keys: |
  50.            ${{ runner.os }}-pnpm-store-
  51.  
  52.       - name: Install dependencies
  53.         run: pnpm install
  54.  
  55.       - name: Build
  56.         run: pnpm build
  57.  
  58.       - name: Setup Pages
  59.         uses: actions/configure-pages@v3.0.6
  60.       - name: Upload artifact
  61.         uses: actions/upload-pages-artifact@v2
  62.         with:
  63.          # Upload dist repository
  64.           path: './dist'
  65.       - name: Deploy to GitHub Pages
  66.         id: deployment
  67.         uses: actions/deploy-pages@v2.0.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement