Skip to content

update-content

update-content #222

Workflow file for this run

name: CI
on:
push:
branches: [main]
workflow_dispatch:
repository_dispatch:
types: [update-content]
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: true
env:
TZ: Asia/Shanghai
jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
secrets: inherit
deploy-github:
name: Deploy to GitHub Pages
if: github.ref_name == 'main' && github.event_name != 'pull_request' && github.repository == 'zotero-chinese/website'
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Build Output
uses: actions/download-artifact@v4
with:
name: build-result
path: dist
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: zotero-chinese/zotero-chinese.github.io
branch: gh-pages
folder: dist
single-commit: true
token: ${{ secrets.ACCESS_TOKEN }}
git-config-name: github-actions[bot]
git-config-email: github-actions[bot]@users.noreply.github.com
deploy-netlify:
name: Deploy to Netlify
if: github.ref_name == 'main' && github.event_name != 'pull_request' && github.repository == 'zotero-chinese/website'
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Build Output
uses: actions/download-artifact@v4
with:
name: build-result
path: dist
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: 20.x
# registry-url: 'https://registry.npmjs.org'
# cache: pnpm
- name: Install Netlify CLI
run: pnpm install -g netlify-cli
- name: Push to Netlify
uses: nick-fields/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: netlify deploy --dir 'dist' --prod --debug
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}