Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 1.41 KB

README.md

File metadata and controls

43 lines (37 loc) · 1.41 KB

GitHub Action to deploy MkDocs site to Tencent Cos

GitHub Badge

部署Mkdocs到腾讯云COS静态网站

Intro

推送触发,GitHub Action进行构建,并自动推送到腾讯云COS。通过设置COS域名,实现静态网站访问。

Example

在对应的 mkdocs git仓库中创建.github/workflows/deploy.yml

name: Deploy to tencent osss
on:
  push:
    branches:
      - master

jobs:
  build:
    name: Deploy docs
    runs-on: ubuntu-latest
    steps:
      - name: Checkout main
        uses: actions/checkout@v2

      - name: Deploy to tencent osss
        uses: aschenmaker/mkdocs-deploy-tencentcos@master
        env:
          CONFIG_FILE: mkdocs.yml
          SECRET_ID: ${{ secrets.SECRET_ID }}
          SECRET_KEY: ${{ secrets.SECRET_KEY }}
          BUCKET: ${{ secrets.BUCKET }}
          REGION: ap-nanjing

SECRET_ID,SECRET_KEY,BUCKET需要设置在仓库Settings-Secret中进行配置

参数 说明 是否必须
CONFIG_FILE 配置文件位置
SECRET_ID API密钥,腾讯云中获取
SECRET_KEY API-key,腾讯云中获取
BUCKET 存储桶名称
REGION 存储桶位置