From 50a1ea57e92ac75a376d08881e3d0822a7c1c89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Wed, 3 Apr 2024 16:47:34 +0800 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 100 +++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..79e4772f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,100 @@ +run-name: Deploy + +on: + push: + branches: + - main + + release: + types: + - published + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: "18.x" + + - name: Install Hexo + run: | + npm install hexo-cli -g + + - name: Cache Modules + uses: actions/cache@v1 + id: cache-modules + with: + path: node_modules + key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} + - name: npm Install + run: | + npm install + - name: Generate + run: | + hexo clean + hexo generate + - name: Deploy + run: | +run-name: Deploy + +on: + push: + branches: + - main + + release: + types: + - published + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: "18.x" + + - name: Install Hexo + run: | + npm install hexo-cli -g + + - name: Cache Modules + uses: actions/cache@v1 + id: cache-modules + with: + path: node_modules + key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} + - name: npm Install + run: | + npm install + - name: Generate + run: | + hexo clean + hexo generate + - name: Deploy + run: | + #git config --global user.name "jkjoy" + #git config --global user.email "jkjoy@live.cn" + #git clone https://github.com/jkjoy/blog.git .deploy_git + #export TZ='Asia/Shanghai' + hexo deploy + hexo deploy