From 1f2502aff1e28e608c2a6afda0aea7780f4dea92 Mon Sep 17 00:00:00 2001 From: EthanThatOneKid <31261035+EthanThatOneKid@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:23:25 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=99=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/godoc_preview.yaml | 57 ++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/godoc_preview.yaml diff --git a/.github/workflows/godoc_preview.yaml b/.github/workflows/godoc_preview.yaml new file mode 100644 index 0000000..0979607 --- /dev/null +++ b/.github/workflows/godoc_preview.yaml @@ -0,0 +1,57 @@ +name: Generate Documentation Preview + +on: + pull_request: + branches: + - "*" + push: + branches: + - "*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: "1.21" + + - name: Install godoc + run: go install -v golang.org/x/tools/cmd/godoc@latest + + - name: Generate Documentation + run: | + godoc -http=:6060 & sleep 5 + curl -sSf http://localhost:6060/pkg/ > path/to/generated/documentation/index.html + + - name: Upload Documentation Preview + uses: actions/upload-artifact@v2 + with: + name: documentation-preview + path: path/to/generated/documentation + + deploy: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download Documentation Preview + uses: actions/download-artifact@v2 + with: + name: documentation-preview + path: path/to/generated/documentation + + - name: Deploy Documentation Preview + run: | + # You can deploy the generated documentation preview to a hosting service + # For example, if you're using GitHub Pages: + mkdir -p docs + mv path/to/generated/documentation/* docs/${{ event.base_ref }} + git add docs + git commit -m "Update documentation preview" + git push origin HEAD diff --git a/.gitignore b/.gitignore index 3b735ec..8037893 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ # Go workspace file go.work +db.sqlite