Merge pull request #1 from aleksanderpalamar/gh-pages #12
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: Swagger Doc | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
swagger-doc: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.18' # Certifique-se de usar a versão correta do Go | |
- name: Install swag | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
echo "$HOME/go/bin" >> $GITHUB_PATH | |
- name: Generate Swagger Doc | |
run: swag init -g ./main.go --output ./docs | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: ./docs |