Skip to content

Commit

Permalink
Update config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hesetiema committed Apr 29, 2024
1 parent 938fabc commit 799ae9d
Showing 1 changed file with 52 additions and 17 deletions.
69 changes: 52 additions & 17 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,65 @@ concurrency:

jobs:
# 单次部署的工作描述
deploy:
job:
name: Deployment
runs-on: macos-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
uses: actions/checkout@v3

# setup node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
node-version: 16

# setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
run_install: false

# cache
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# cache fail and install dependencies
- name: Install dependencies
run: npm ci
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: |
pnpm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
run: pnpm run build

- name: upload production artifacts
uses: actions/upload-pages-artifact@v1
with:
# Upload dist folder
path: './dist'
- name: Deploy to GitHub Pages
path: dist

# deploy
- name: Deploy Page To Release
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v1


0 comments on commit 799ae9d

Please sign in to comment.