mirror of
https://github.com/cioyu/cioyu.github.io.git
synced 2026-05-02 13:31:47 +08:00
36 lines
747 B
YAML
36 lines
747 B
YAML
# 此脚本借鉴了https://blog.csdn.net/m0_74916313/article/details/151333440
|
|
name: Vue自动部署到github pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
- run: yarn
|
|
- run: yarn build
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./dist
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- uses: actions/deploy-pages@v4
|
|
id: deployment |