update custom.styl #462
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: hexo-deploy-cos | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
types: | |
- notion-update | |
env: | |
FTP_HOST: ${{secrets.FTP_HOST}} | |
FTP_PORT: ${{secrets.FTP_PORT}} | |
FTP_USERNAME: ${{secrets.FTP_USERNAME}} | |
FTP_PASSWORD: ${{secrets.FTP_PASSWORD}} | |
FTP_REMOTE: ${{secrets.FTP_REMOTE}} | |
NOTION_TOKEN: ${{secrets.NOTION_TOKEN}} | |
NOTION_DATABASE_ID: ${{secrets.NOTION_DATABASE_ID}} | |
COS_SECRET_ID: ${{secrets.COS_SECRET_ID}} | |
COS_SECRET_KEY: ${{secrets.COS_SECRET_KEY}} | |
COS_BUCKET: ${{secrets.COS_BUCKET}} | |
COS_REGION: ${{secrets.COS_REGION}} | |
COS_HOST: ${{secrets.COS_HOST}} | |
COS_PREFIXKEY: ${{secrets.COS_PREFIXKEY}} | |
SITE_URL: ${{secrets.SITE_URL}} | |
jobs: | |
build: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
# in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded | |
operating-system: ['ubuntu-20.04'] | |
steps: | |
- name: 检查分支 | |
uses: actions/checkout@master | |
- name: 安装node环境 | |
uses: actions/setup-node@master | |
with: | |
node-version: "16.14.0" | |
- name: Install depends | |
run: | | |
npm install | |
- name: Elog Sync | |
run: | | |
npm run elog:sync | |
- name: 提交notion拉取的文章到GitHub仓库 | |
run: | | |
echo `date +"%Y-%m-%d %H:%M:%S"` begin > time.txt | |
git config --global user.email "qq88268459@126.com" | |
git config --global user.name "bmqy" | |
git add . | |
git commit -m "更新文档" -a | |
- name: Clean | |
run: | | |
npm run clean | |
- name: Build | |
run: | | |
npm run build | |
- name: Deploy | |
run: | | |
npm run deploy | |
# - name: 📂 Deploy Ftp | |
# uses: SamKirkland/FTP-Deploy-Action@v4.3.4 | |
# with: | |
# server: ${{ secrets.FTP_HOST }} | |
# port: ${{ secrets.FTP_PORT }} | |
# username: ${{ secrets.FTP_USERNAME }} | |
# password: ${{ secrets.FTP_PASSWORD }} | |
# local-dir: './public/' | |
# server-dir: ${{ secrets.FTP_REMOTE }} | |
- name: TencentCloud CDN Action # 刷新腾讯云CDN | |
uses: suxuelengyin/Tencent-CDN-Action@v1.1 | |
with: | |
secret_id: ${{ secrets.COS_SECRET_ID }} | |
secret_key: ${{ secrets.COS_SECRET_KEY }} | |
paths: ${{ secrets.SITE_URL }} | |
- name: Run with setup-python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
update-environment: false | |
cache: 'pipenv' | |
- name: Install pipenv | |
run: pip3 install --user pipenv | |
- name: Install dependecies | |
run: pipenv --python python3 && pipenv install | |
- name: Update readme | |
run: pipenv run python readme.py | |
- name: Commit README.md # 更新README.md | |
run: | | |
git diff | |
git add README.md | |
git commit -m "Github Action Auto Updated" | |
- name: 推送更新到仓库 | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Notify workflow status to telegram | |
uses: yakuhzi/notify-workflow@v2 | |
if: always() | |
with: | |
chat_id: ${{ secrets.TELEGRAM_TO }} | |
bot_token: ${{ secrets.TELEGRAM_TOKEN }} | |
job_status: ${{ job.status }} |