feat: 恢复部署配置
parent
e5caf7bdec
commit
d76ead755b
|
|
@ -2,39 +2,30 @@ name: 自动部署
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ master ]
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
pages: write
|
contents: write
|
||||||
id-token: write
|
|
||||||
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 克隆代码
|
- name: 克隆代码
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: 设置环境
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
|
|
||||||
- name: 安装依赖
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: 构建产物
|
- name: 构建产物
|
||||||
run: npm run build
|
run: |
|
||||||
|
npm install
|
||||||
- name: 上传产物
|
npm run build
|
||||||
uses: actions/upload-pages-artifact@v2
|
|
||||||
with:
|
|
||||||
path: ./dist
|
|
||||||
|
|
||||||
- name: 部署分支
|
- name: 部署分支
|
||||||
id: deployment
|
run: |
|
||||||
uses: actions/deploy-pages@v2
|
cd dist
|
||||||
|
git config --global user.name "juetan"
|
||||||
|
git config --global user.email "810335188@qq.com"
|
||||||
|
git init
|
||||||
|
git add -A
|
||||||
|
git commit -m "Build through github action"
|
||||||
|
git push -f "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:gh-pages
|
||||||
Loading…
Reference in New Issue