Skip to content

Commit

Permalink
用默认的jekyll github actions 但用npm 构建
Browse files Browse the repository at this point in the history
  • Loading branch information
liruohrh committed May 1, 2024
1 parent 91560de commit 918db35
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 52 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
on: push
name: demo
jobs:
job1:
name: "job1 work"
runs-on: ubuntu-latest
steps:
- name: look pwd
run: pwd
- name: look ls
run: ls
job2:
name: "job2 work"
runs-on: ubuntu-latest
steps:
- name: look go
run: go version
- name: look node
run: node --version
# on: push
# name: demo
# jobs:
# job1:
# name: "job1 work"
# runs-on: ubuntu-latest
# steps:
# - name: look pwd
# run: pwd
# - name: look ls
# run: ls
# job2:
# name: "job2 work"
# runs-on: ubuntu-latest
# steps:
# - name: look go
# run: go version
# - name: look node
# run: node --version
44 changes: 22 additions & 22 deletions .github/workflows/devops.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: build and delopy
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
name: npm构建vite项目
runs-on: ubuntu-latest
steps:
- name: 用git拉取项目
uses: actions/checkout@v4
- run: pwd && ls -al
- name: 安装node依赖&&构建node项目
run: npm install && npm run build
- name: 部署github pages(即push构建目录dist到gh-pages分支)
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
# name: build and delopy
# on:
# push:
# branches:
# - main
# permissions:
# contents: write
# jobs:
# build:
# name: npm构建vite项目
# runs-on: ubuntu-latest
# steps:
# - name: 用git拉取项目
# uses: actions/checkout@v4
# - run: pwd && ls -al
# - name: 安装node依赖&&构建node项目
# run: npm install && npm run build
# - name: 部署github pages(即push构建目录dist到gh-pages分支)
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
name: deploy gitHub pages with npm and no push to branch

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -22,23 +19,18 @@ concurrency:
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: 安装node依赖&&构建node项目
run: npm install && npm run build --outDir=./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
Expand Down

0 comments on commit 918db35

Please sign in to comment.