Skip to content

Build & Deploy

Build & Deploy #799

Workflow file for this run

name: Build & Deploy
on:
push:
branches:
- main
tags:
- v*
schedule:
# 每天 5:30 和 17:30 UTC 触发工作流程
- cron: '30 5,17 * * *'
jobs:
build-deploy:
env:
TOKEN: ${{ secrets.TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm start
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
body: "{{date:YYYY-MM-DD HH:mm:ss}}"
branch: main
- name: Is a tag created auto?
id: create_tag
uses: jaywcjlove/create-tag-action@main
with:
package-path: package.json
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
if: steps.create_tag.outputs.successful == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ steps.create_tag.outputs.version }}
filter-author: (小弟调调™|Renovate Bot|github-actions-bot|renovate-bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- name: Create Release
uses: jaywcjlove/create-tag-action@main
if: steps.create_tag.outputs.successful == 'true'
with:
version: ${{steps.create_tag.outputs.version}}
release: true
body: |
[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}