This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into plugin-metadata
- Loading branch information
Showing
46 changed files
with
16,131 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: godoc | ||
on: | ||
workflow_run: | ||
workflows: | ||
- main | ||
types: | ||
- completed | ||
env: | ||
MOD: github.com/reearth/reearth-backend | ||
REPO: github.com/reearth/reearth-backend | ||
REPO_NAME: reearth-backend | ||
ADDR: 'localhost:8080' | ||
jobs: | ||
godoc: | ||
name: godoc | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
env: | ||
DIR: ${{ github.event.workflow_run.head_branch }} | ||
steps: | ||
- name: set up | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
id: go | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: go mod download | ||
- name: install godoc | ||
run: go install golang.org/x/tools/cmd/godoc@latest | ||
- name: generate docs | ||
continue-on-error: true | ||
run: | | ||
godoc -http="$ADDR" & | ||
sleep 10 | ||
wget -r -np -N -E -p -k "http://${ADDR}/pkg/${MOD}/" | ||
- name: replace urls | ||
run: | | ||
[ `find . -name "*.html" -type f | wc -l` -eq 0 ] && exit 1 | ||
find ./${ADDR}/ -name "*.html" -print0 | xargs -0 sed -i \ | ||
-e "s@http://${ADDR}/src/${MOD}@https://${REPO}/blob/main@" \ | ||
-e "s@\"http://${ADDR}/pkg/\"@\"/${REPO_NAME}/${DIR}/pkg/${REPO}/\"@" \ | ||
-e 's@<form @<form style="display:none" @' \ | ||
-e "s@http://${ADDR}@/${REPO_NAME}/${DIR}@" | ||
- name: deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./${{ env.ADDR }} | ||
destination_dir: ${{ env.DIR }} | ||
slack-notification: | ||
if: always() | ||
name: Slack Notification | ||
needs: godoc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Slack Notification | ||
uses: Gamesight/slack-workflow-status@master | ||
if: always() | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.