@antv/[email protected] #15
Workflow file for this run
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: Deploy Site | |
on: | |
workflow_dispatch: | |
release: | |
# released: only latest release will trigger | |
types: [released] | |
concurrency: | |
group: '${{ github.workflow }} - ${{ github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
publish-site: | |
# manual dispatch or released only @antv/l7 main package | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
( | |
github.event_name == 'release' && | |
startswith(github.event.release.tag_name, '@antv/l7@') | |
) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
uses: ./.github/actions/prepare-install | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: pnpm site:build | |
- run: | | |
cd site/dist | |
git init | |
git config --local user.name antv | |
git config --local user.email [email protected] | |
git add . | |
git commit -m "update by release action" | |
- uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
directory: site/dist | |
branch: gh-pages | |
force: true | |
# Deploy site successful notify, only trigger by bot release | |
- name: Deploy site successful notify | |
if: ${{ success() && github.event_name == 'release' }} | |
uses: zcong1993/actions-ding@master | |
with: | |
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }} | |
ignoreError: true | |
body: | | |
{ | |
"msgtype": "text", | |
"text": { | |
"content": "官网部署成功, 请手动同步雨燕站点", | |
} | |
} | |
# Deploy site failed notify, only trigger by bot release | |
- name: 🔊 Deploy failed notify | |
if: ${{ failure() && github.event_name == 'release' }} | |
uses: zcong1993/actions-ding@master | |
with: | |
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }} | |
ignoreError: true | |
body: | | |
{ | |
"msgtype": "link", | |
"link": { | |
"title": "🚨 官网部署失败", | |
"text": "🔗 请点击链接查看具体原因, 尝试点击右上角 [Re-run all jobs] 重试, 或者手动部署 🚑", | |
"messageUrl": "https://github.com/antvis/L7/actions/workflows/deploy-site.yml", | |
"picUrl": "" | |
} | |
} |