Skip to content

Commit

Permalink
chore: add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aehyok committed Aug 15, 2024
1 parent b5b0c1b commit 1bb4b4e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/togithub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build to my github

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [node16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install PNPM
run: npm i -g pnpm
- name: Install & Build
run: pnpm install --no-frozen-lockfile && pnpm run build

# - name: CreateTag
# run git tag -a
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
41 changes: 41 additions & 0 deletions .github/workflows/tome.yml-bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build to my server
on:
push:
branches:
- main # 这里表示push到main分支就会触发流程
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 这是github官方的一个action,用于clone该仓库的源码到工作流中,
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Build
run: |
npm install # 安装依赖
npm run build # 执行打包

# 连接到ssh,并且做一个拷贝操作的action
- name: Deploy 🚀
uses: appleboy/scp-action@master
with:
host: ${{ secrets.AK_HOST }} # 服务器host
username: ${{ secrets.AK_USER }} # 服务器用户名
password: ${{ secrets.AK_PASS }} # 服务器密码
source: './docs/.vitepress/dist/*' # 需要上传的文件, 多文件使用逗号隔开
target: '/usr/local/qiankun/blog' # 上传到服务器的什么位置

# uses: cross-the-world/scp-pipeline@master
# env:
# WELCOME: "ssh scp ssh pipelines"
# LASTSSH: "Doing something after copying"
# with:
# host: ${{ secrets.AK_HOST }}
# user: ${{ secrets.AK_USER }}
# pass: ${{ secrets.AK_PASS }}
# connect_timeout: 10s
# local: './docs/.vitepress/dist/*' # 这里是下一步要创建的vue项目构建完成后的静态资源路径
# remote: /usr/local/qiankun/blog # 这里是 step1 中,在服务器上创建用于存放静态资源的文件夹

0 comments on commit 1bb4b4e

Please sign in to comment.