This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
CIの追加 #17
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: pr-visualizer | |
on: | |
pull_request: | |
permissions: | |
pull-requests: write | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
visualizer: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install and Build | |
run: | | |
npm install | |
npm run build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist/visualizer/ | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 | |
id: deployment | |
with: | |
branch: ${{ github.head_ref }} | |
- name: Find existing comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.number }} | |
format: 'json' | |
- name: Create comment | |
uses: peter-evans/create-or-update-comment@v2 | |
if: success() && github.event.number && steps.fc.outputs.comment-id == '0' | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
**Visualizer Report** | |
- You can view the results [here](${{ steps.deployment.outputs.page_url }}). | |
- name: Update comment | |
uses: peter-evans/create-or-update-comment@v2 | |
if: success() && github.event.number && steps.fc.outputs.comment-id != '0' | |
with: | |
issue-number: ${{ github.event.number }} | |
includes-comment: "<!-- __VISUALIZER -->" | |
body: | | |
**Visualizer Report** | |
- You can view the results [here](${{ steps.deployment.outputs.page_url }}). | |
edit-mode: replace |