Skip to content

Commit

Permalink
Merge branch 'master' into Yang-33-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 authored Nov 26, 2024
2 parents 3172c9b + ba674de commit 71e36de
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 7 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ jobs:
with:
path: docs/.vitepress/dist

- name: Create GitHub Issue on Failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const issueTitle = `build-page job failed`;
const issueBody = `The build-page job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
const assignees = [context.actor];
await github.rest.issues.create({
owner,
repo,
title: issueTitle,
body: issueBody,
assignees
});
deploy:
environment:
name: github-pages
Expand All @@ -48,3 +66,21 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Create GitHub Issue on Failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const issueTitle = `deploy-page job failed`;
const issueBody = `The deploy-page job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
const assignees = [context.actor];
await github.rest.issues.create({
owner,
repo,
title: issueTitle,
body: issueBody,
assignees
});
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,31 @@ jobs:
VERSION=${{ github.event.release.tag_name }}
fi
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
node ./scripts/update-version.mjs $VERSION
- run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_2 }}

- name: Create GitHub Issue on Failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const version = process.env.VERSION;
const issueTitle = `Release job for ${version} failed`;
const issueBody = `The release job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
const assignees = [context.actor];
await github.rest.issues.create({
owner,
repo,
title: issueTitle,
body: issueBody,
assignees
});
deploy-docs:
needs: [release-package]
uses: ./.github/workflows/deploy-doc.yml
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 71e36de

Please sign in to comment.