md/.github/workflows/build.yml

34 lines
644 B
YAML
Raw Normal View History

2020-05-02 20:31:24 +08:00
name: Build and Deploy
2020-12-02 14:37:05 +08:00
2020-05-02 19:45:26 +08:00
on:
push:
2021-02-26 10:47:40 +08:00
branches: [main]
2021-11-23 14:22:01 +08:00
workflow_dispatch:
2020-12-02 14:37:05 +08:00
2020-05-02 19:45:26 +08:00
jobs:
2020-05-02 20:31:24 +08:00
build-and-deploy:
2020-05-02 19:45:26 +08:00
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
2020-05-02 19:45:26 +08:00
steps:
2020-05-02 20:31:24 +08:00
- name: Checkout
2023-05-10 17:23:23 +08:00
uses: actions/checkout@v3
2020-05-02 20:31:24 +08:00
with:
persist-credentials: false
2021-02-26 10:47:40 +08:00
2020-11-25 09:47:08 +08:00
- name: Set up node
2023-05-10 17:23:23 +08:00
uses: actions/setup-node@v3
2020-11-25 09:47:08 +08:00
with:
2023-05-10 17:54:48 +08:00
node-version: 20
2021-02-26 10:47:40 +08:00
2020-11-25 09:47:08 +08:00
- name: Install dependencies
run: npm install
2020-05-02 20:31:24 +08:00
2020-11-25 09:47:08 +08:00
- name: Build
2021-02-26 10:47:40 +08:00
run: npm run build
2020-05-02 20:31:24 +08:00
- name: Deploy
2023-05-10 19:58:10 +08:00
uses: JamesIves/github-pages-deploy-action@v4
2020-05-02 20:31:24 +08:00
with:
2021-08-22 11:55:00 +08:00
branch: gh-pages
folder: dist