fix: io error github pt2 #102
This file contains hidden or 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: Go CI & Site Deployment | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint-test: | |
| name: Lint & Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Run gofmt | |
| run: | | |
| echo "Running gofmt..." | |
| test -z "$(gofmt -l .)" || (echo "Go code is not formatted. Run 'gofmt -w .' and commit." && exit 1) | |
| echo "gofmt check passed." | |
| - name: Run Go Vet | |
| run: go vet ./... | |
| - name: Run Go Tests | |
| run: go test -v ./... | |
| deploy-site: | |
| name: Build and Deploy Site | |
| runs-on: ubuntu-latest | |
| needs: lint-test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Install Nova | |
| run: | | |
| go install github.com/xlc-dev/nova@latest | |
| echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| nova gendoc --output ./www/src/docs/reference.md | |
| - name: Build static site | |
| run: FSSG_BASE_URL="/nova" ./www/fssg | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "./www/dist/" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |