Skip to content

Commit

Permalink
Create gh-action-config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
InfSein authored Mar 12, 2024
1 parent fb14e11 commit 35e31b2
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/gh-action-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Deploy
# 监听 master 分支上的 push 事件
on:
push:
branches:
- master
jobs:
build-and-deploy:
# 构建环境使用 ubuntu
runs-on: ubuntu-latest
steps:
# 官方action, 将代码拉取到虚拟机
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

# 安装node.js
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "20.8.1"

# 下载依赖、打包项目
- name: Install and Build
run: |
yarn install
yarn build
# 部署
- name: Deploy
uses: JamesIves/[email protected]
with:
# 项目配置的打包目录名称
folder: dist
# 部署后提交到的分支
branch: static-pages

0 comments on commit 35e31b2

Please sign in to comment.