diff --git a/.github/workflows/docs-build-push.yml b/.github/workflows/docs-build-push.yml new file mode 100644 index 0000000000..6097c7d455 --- /dev/null +++ b/.github/workflows/docs-build-push.yml @@ -0,0 +1,40 @@ +name: Build and deploy docs +on: + workflow_dispatch: + inputs: + environment: + description: 'Environment to deploy to' + required: true + default: 'preview' + type: choice + options: + - preview + - dev + - staging + - prod + pull_request: + branches: + - "*" + paths: + - "site/**" + +permissions: + contents: read + +jobs: + call-docs-build-push: + if: ${{ github.event.repository.fork == false }} + uses: nginxinc/docs-actions/.github/workflows/docs-build-push.yml@03a9a3808fcb77cd0c19d7fa5d59b25565dd1d6d # v1.0.2 + permissions: + pull-requests: write # needed to write preview url comment to PR + contents: read + with: + production_url_path: "/nginx-gateway-fabric" + preview_url_path: "/previews/nginx-gateway-fabric" + docs_source_path: "public/nginx-gateway-fabric" + docs_build_path: "./site" + doc_type: "hugo" + environment: ${{ inputs.environment }} + secrets: + AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS_DOCS }} + AZURE_KEY_VAULT: ${{ secrets.AZURE_KEY_VAULT_DOCS }} diff --git a/site/README.md b/site/README.md index c5932c3ecf..98c5d36e80 100644 --- a/site/README.md +++ b/site/README.md @@ -2,7 +2,7 @@ This directory contains all of the user documentation for NGINX Gateway Fabric, as well as the requirements for building and publishing the documentation. -Documentation is written in Markdown, built using [Hugo](https://gohugo.io) with [nginx-hugo-theme](https://github.com/nginxinc/nginx-hugo-theme), then deployed with [Netlify](https://www.netlify.com/). +We write our documentation in Markdown. We build it with [Hugo](https://gohugo.io) and our custom [NGINX Hugo theme](https://github.com/nginxinc/nginx-hugo-theme). We set up previews and deployments using our [docs-actions](https://github.com/nginxinc/docs-actions?tab=readme-ov-file#docs-actions) workflow. ## Setup diff --git a/site/netlify.toml b/site/netlify.toml deleted file mode 100644 index 5059ca2c24..0000000000 --- a/site/netlify.toml +++ /dev/null @@ -1,35 +0,0 @@ -[build] - base = "site/" - publish = "public" - command = "hugo --gc -b $DEPLOY_PRIME_URL/nginx-gateway-fabric" - -[context.production] - command = "make all" - -[context.docs-development] - command = "make all-dev" - -[context.docs-staging] - command = "make all-staging" - -[context.branch-deploy] - command = "make deploy-preview" - -[context.deploy-preview] - command = "make deploy-preview" - -[[headers]] - for = "/*" - [headers.values] - Access-Control-Allow-Origin = "https://docs.nginx.com" - -[[redirects]] - from = "/" - to = "/nginx-gateway-fabric/" - status = 301 - force = true - -[[redirects]] - from = "/nginx-gateway-fabric/*" - to = "/nginx-gateway-fabric/404.html" - status = 404