Skip to content

Commit

Permalink
feat: 新增自动部署
Browse files Browse the repository at this point in the history
  • Loading branch information
songxingguo committed Jan 16, 2024
1 parent dc98bb7 commit 39c7a0e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 静态博客构建
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: "12.0.0"
- name: Install and Build 🔧
run: |
npm i
npm run build
- name: 推送到代码仓库
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_REF: 'github.com/songxingguo/demo.git'
CO_TOKEN: ${{ secrets.CO_TOKEN }}
CO_REF: 'e.coding.net/songxingguo/songxingguo.coding.me/demo.git'
run: |
cd ./build
git init
git config user.name "songxingguo"
git config user.email "[email protected]"
git add .
git commit -m "Update Blog By GithubAction With Build $TRAVIS_BUILD_NUMBER"
# Github Pages
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
# Coding Pages
git push --force --quiet "https://zrUWsPQJyF:${CO_TOKEN}@${CO_REF}" master:master

0 comments on commit 39c7a0e

Please sign in to comment.