Skip to content

Commit

Permalink
feat: store files in fork repo
Browse files Browse the repository at this point in the history
Signed-off-by: zhy76 <[email protected]>
  • Loading branch information
zhy76 committed Sep 5, 2023
1 parent 36785be commit 33fa24d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
GOPATH: ${{ runner.workspace }}
GO111MODULE: "on"
# Checkout to your repo
- name: Checkout
- name: Checkout to your repo
uses: actions/checkout@v3
# Install k3s cluster(You can setup a k8s cluster here)
- name: Setup k3s cluster
Expand Down Expand Up @@ -95,25 +95,32 @@ jobs:
with:
name: ${{ steps.visualisation.outputs.visualisation-results-artifact }}
path: images
# Checkout to fork repo
- name: Checkout to fork repo
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
# Store the latest summary report file
- name: Store the latest summary report file
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.PERSONAL_TOKEN }}
external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
publish_dir: ./summary_reports
keep_files: true
# Store the visualisation results
- name: Store the visualisation results
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.PERSONAL_TOKEN }}
external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
publish_dir: ./images
keep_files: true
# Comment the visualisation results on the PR
- name: Comment on PR
run: |
gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Delete the new app
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
GOPATH: ${{ runner.workspace }}
GO111MODULE: "on"
# Checkout to your repo
- name: Checkout
- name: Checkout to your repo
uses: actions/checkout@v3
# Install k3s cluster(You can setup a k8s cluster here)
- name: Setup k3s cluster
Expand Down Expand Up @@ -157,25 +157,32 @@ jobs:
with:
name: ${{ steps.visualisation.outputs.visualisation-results-artifact }}
path: images
# Checkout to fork repo
- name: Checkout to fork repo
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
# Store the latest summary report file
- name: Store the latest summary report file
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.PERSONAL_TOKEN }}
external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
publish_dir: ./summary_reports
keep_files: true
# Store the visualisation results
- name: Store the visualisation results
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.PERSONAL_TOKEN }}
external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}
publish_dir: ./images
keep_files: true
# Comment the visualisation results on the PR
- name: Comment on PR
run: |
gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})"
gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.name }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Delete the new app
Expand Down

0 comments on commit 33fa24d

Please sign in to comment.