文档数据库 #60
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: on-issues | |
on: | |
issues: | |
types: ['labeled', 'unlabeled', 'edited', 'reopened', 'closed', 'deleted'] | |
permissions: | |
pages: write | |
id-token: write | |
# push | |
contents: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPO: ${{ github.repository }} | |
GITHUB_ISSUE_NUMBER: ${{ github.event.issue.number }} | |
GITHUB_ISSUE_LABEL: ${{ github.event.label.name }} | |
GITHUB_ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ',') }} | |
GITHUB_EVENT_ACTION: ${{ github.event.action }} | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: issues-page | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn --frozen-lockfile | |
- name: Get issue | |
run: yarn single | |
- name: Build | |
run: yarn build --base /${{ github.event.repository.name }}/ | |
- name: Push | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit -m "bot update" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: issues-page | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/configure-pages@v2 | |
- uses: actions/upload-pages-artifact@v1 | |
with: | |
path: docs/.vitepress/dist | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
if: ${{ success() }} | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v1 | |
fallback: | |
permissions: | |
actions: write | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ failure() }} | |
steps: | |
- name: trigger on-push | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: on-push.yml |