CI #617
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: CI | |
on: | |
schedule: | |
- cron: '25 0 * * *' | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
lint: | |
name: Lint | |
if: github.event_name != 'schedule' | |
uses: ./.github/workflows/lint.yml | |
secrets: inherit | |
build: | |
name: Build | |
if: github.repository == 'zotero-chinese/zotero-plugins' && github.event_name != 'pull_request' | |
uses: ./.github/workflows/build.yml | |
secrets: inherit | |
deploy: | |
name: Deploy to GitHub | |
needs: | |
- build | |
if: github.repository == 'zotero-chinese/zotero-plugins' && github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Download Build Output | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4.6.8 | |
with: | |
branch: gh-pages | |
folder: dist | |
single-commit: true | |
git-config-name: github-actions[bot] | |
git-config-email: github-actions[bot]@users.noreply.github.com | |
sync-gitee: | |
name: Sync to Gitee | |
needs: | |
- deploy | |
if: github.repository == 'zotero-chinese/zotero-plugins' && github.event_name != 'pull_request' | |
uses: ./.github/workflows/sync-to-gitee.yml | |
secrets: inherit | |
send-dispatch: | |
name: Send dispatch to website | |
if: github.repository == 'zotero-chinese/zotero-plugins' && github.event_name != 'pull_request' | |
needs: | |
- deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
repository: zotero-chinese/website | |
event-type: update-triggered-by-plugins-repo |