Recursor: add types and descriptions to dynamic metrics defined in Lua #7699
Workflow file for this run
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
| # This workflow builds and publishes documentation for PowerDNS products. | |
| # It is controlled by the following variables and secrets: | |
| # Variables: | |
| # - PUBLISH_DOCS_TO_AWS: Set to 'true' to enable publishing to AWS | |
| # - PUBLISH_DOCS_TO_WEB1: Set to 'true' to enable publishing to Web1 | |
| # - DOCS_WORKFLOW_BRANCH_OVERRIDE: Set to 'true' to allow publishing from non-master branches (for testing) | |
| # - AWS_REGION: AWS region for S3 and CloudFront | |
| # - AWS_S3_BUCKET_DOCS: S3 bucket name for documentation | |
| # - AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST: CloudFront distribution ID for DNSdist docs | |
| # - AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS: CloudFront distribution ID for PowerDNS docs | |
| # - REC_DOCS_DIR: Directory for Recursor docs on Web1 | |
| # - AUTH_DOCS_DIR: Directory for Authoritative Server docs on Web1 | |
| # - WEB1_HOSTKEY: SSH host key for Web1 | |
| # - DOCS_HOST: Hostname for documentation server | |
| # Secrets: | |
| # - AWS_ACCESS_KEY_ID: AWS access key ID | |
| # - AWS_SECRET_ACCESS_KEY: AWS secret access key | |
| # - WEB1_DOCS_SECRET: SSH key for Web1 access | |
| --- | |
| name: 'Documentation' | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true | |
| jobs: | |
| build-docs: | |
| name: Build docs | |
| runs-on: ubuntu-22.04 | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| outputs: | |
| pdns_version: ${{ steps.get-version.outputs.pdns_version }} | |
| steps: | |
| - uses: PowerDNS/pdns/set-ubuntu-mirror@meta | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - run: pip install pyyaml | |
| - run: build-scripts/gh-actions-setup-inv-no-dist-upgrade | |
| - run: inv install-doc-deps | |
| - run: inv install-doc-deps-pdf | |
| - id: get-version | |
| run: | | |
| echo "pdns_version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| # Build Auth docs | |
| - run: inv ci-docs-build | |
| - run: mv html auth-html-docs | |
| working-directory: ./docs/_build | |
| - run: tar cf auth-html-docs.tar auth-html-docs | |
| working-directory: ./docs/_build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: authoritative-html-docs-${{steps.get-version.outputs.pdns_version}} | |
| path: ./docs/_build/auth-html-docs.tar | |
| - run: inv ci-docs-build-pdf | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: PowerDNS-Authoritative-${{steps.get-version.outputs.pdns_version}}.pdf | |
| path: ./docs/_build/latex/PowerDNS-Authoritative.pdf | |
| - name: Copy PDF to HTML docs directory | |
| run: | | |
| cp ./docs/_build/latex/PowerDNS-Authoritative.pdf ./docs/_build/auth-html-docs/ | |
| # Build Rec docs | |
| - run: inv ci-metrics-rec-generate | |
| working-directory: ./pdns/recursordist | |
| - run: inv ci-docs-rec-generate | |
| working-directory: ./pdns/recursordist/rec-rust-lib | |
| - run: inv ci-docs-build | |
| working-directory: ./pdns/recursordist | |
| - run: mv html rec-html-docs | |
| working-directory: ./pdns/recursordist/docs/_build | |
| - run: tar cf rec-html-docs.tar rec-html-docs | |
| working-directory: ./pdns/recursordist/docs/_build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: recursor-html-docs-${{steps.get-version.outputs.pdns_version}} | |
| path: ./pdns/recursordist/docs/_build/rec-html-docs.tar | |
| - run: inv ci-docs-build-pdf | |
| working-directory: ./pdns/recursordist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: PowerDNS-Recursor-${{steps.get-version.outputs.pdns_version}}.pdf | |
| path: ./pdns/recursordist/docs/_build/latex/PowerDNS-Recursor.pdf | |
| - name: Copy PDF to HTML docs directory | |
| run: | | |
| cp ./pdns/recursordist/docs/_build/latex/PowerDNS-Recursor.pdf ./pdns/recursordist/docs/_build/rec-html-docs/ | |
| # Build DNSdist docs | |
| - run: inv ci-docs-dnsdist-generate | |
| working-directory: ./pdns/dnsdistdist | |
| - run: inv ci-docs-build | |
| working-directory: ./pdns/dnsdistdist | |
| - run: mv html dnsdist-html-docs | |
| working-directory: ./pdns/dnsdistdist/docs/_build | |
| - run: tar cf dnsdist-html-docs.tar dnsdist-html-docs | |
| working-directory: ./pdns/dnsdistdist/docs/_build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dnsdist-html-docs-${{steps.get-version.outputs.pdns_version}} | |
| path: ./pdns/dnsdistdist/docs/_build/dnsdist-html-docs.tar | |
| - run: inv ci-docs-build-pdf | |
| working-directory: ./pdns/dnsdistdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dnsdist-${{steps.get-version.outputs.pdns_version}}.pdf | |
| path: ./pdns/dnsdistdist/docs/_build/latex/dnsdist.pdf | |
| - name: Copy PDF to HTML docs directory | |
| run: | | |
| cp ./pdns/dnsdistdist/docs/_build/latex/dnsdist.pdf ./pdns/dnsdistdist/docs/_build/dnsdist-html-docs/ | |
| # Build website | |
| - name: Build website | |
| run: | | |
| tar cf website.tar website | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: website-${{steps.get-version.outputs.pdns_version}} | |
| path: website.tar | |
| publish-to-web1: | |
| name: Publish to Web1 | |
| needs: build-docs | |
| if: ${{ (github.ref_name == 'master' || vars.DOCS_WORKFLOW_BRANCH_OVERRIDE == 'true') && vars.PUBLISH_DOCS_TO_WEB1 == 'true' }} | |
| runs-on: ubuntu-22.04 | |
| env: | |
| PDNS_VERSION: ${{needs.build-docs.outputs.pdns_version}} | |
| DOCS_HOST: ${{vars.DOCS_HOST}} | |
| REC_DOCS_DIR: ${{vars.REC_DOCS_DIR}} | |
| AUTH_DOCS_DIR: ${{vars.AUTH_DOCS_DIR}} | |
| SSH_KEY: ${{secrets.WEB1_DOCS_SECRET}} | |
| HOST_KEY: ${{vars.WEB1_HOSTKEY}} | |
| steps: | |
| - name: Check required secrets | |
| run: | | |
| missing_secrets=() | |
| [ -z "$SSH_KEY" ] && missing_secrets+=("WEB1_DOCS_SECRET") | |
| [ -z "$HOST_KEY" ] && missing_secrets+=("WEB1_HOSTKEY") | |
| [ -z "$DOCS_HOST" ] && missing_secrets+=("DOCS_HOST") | |
| [ -z "$AUTH_DOCS_DIR" ] && missing_secrets+=("AUTH_DOCS_DIR") | |
| [ -z "$REC_DOCS_DIR" ] && missing_secrets+=("REC_DOCS_DIR") | |
| if [ ${#missing_secrets[@]} -ne 0 ]; then | |
| echo "Error: The following secrets/variables are missing: ${missing_secrets[*]}" | |
| exit 1 | |
| fi | |
| - uses: PowerDNS/pdns/set-ubuntu-mirror@meta | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - run: build-scripts/gh-actions-setup-inv-no-dist-upgrade | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - id: setup-ssh | |
| run: |- | |
| inv ci-docs-add-ssh --ssh-key="$SSH_KEY" --host-key="$HOST_KEY" | |
| - name: Publish Auth docs | |
| run: | | |
| mkdir -p ./docs/_build | |
| tar -xf artifacts/authoritative-html-docs-$PDNS_VERSION/auth-html-docs.tar -C ./docs/_build/ | |
| cp artifacts/PowerDNS-Authoritative-$PDNS_VERSION.pdf/PowerDNS-Authoritative.pdf ./docs/_build/auth-html-docs/ | |
| inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="PowerDNS-Authoritative.pdf" --username="docs_powerdns_com" --product="auth" --directory="/${AUTH_DOCS_DIR}/" | |
| - name: Publish Recursor docs | |
| run: | | |
| tar -xf artifacts/recursor-html-docs-$PDNS_VERSION/rec-html-docs.tar -C ./docs/_build/ | |
| cp artifacts/PowerDNS-Recursor-$PDNS_VERSION.pdf/PowerDNS-Recursor.pdf ./docs/_build/rec-html-docs/ | |
| inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="PowerDNS-Recursor.pdf" --username="docs_powerdns_com" --product="rec" --directory="/${REC_DOCS_DIR}/" | |
| - name: Publish DNSdist docs | |
| run: | | |
| tar -xf artifacts/dnsdist-html-docs-$PDNS_VERSION/dnsdist-html-docs.tar -C ./docs/_build/ | |
| cp artifacts/dnsdist-$PDNS_VERSION.pdf/dnsdist.pdf ./docs/_build/dnsdist-html-docs/ | |
| inv ci-docs-upload-master --docs-host="${DOCS_HOST}" --pdf="dnsdist.pdf" --username="dnsdist_org" --product="dnsdist" --directory="/${DNSDIST_DOCS_DIR}/" | |
| publish-to-aws: | |
| name: Publish to AWS | |
| needs: build-docs | |
| if: ${{ (github.ref_name == 'master' || vars.DOCS_WORKFLOW_BRANCH_OVERRIDE == 'true') && vars.PUBLISH_DOCS_TO_AWS == 'true' }} | |
| runs-on: ubuntu-22.04 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| AWS_S3_BUCKET_DOCS: ${{ vars.AWS_S3_BUCKET_DOCS }} | |
| AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST }} | |
| AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS }} | |
| PDNS_VERSION: ${{needs.build-docs.outputs.pdns_version}} | |
| steps: | |
| - name: Check required secrets | |
| run: | | |
| missing_secrets=() | |
| [ -z "$AWS_ACCESS_KEY_ID" ] && missing_secrets+=("AWS_ACCESS_KEY_ID") | |
| [ -z "$AWS_SECRET_ACCESS_KEY" ] && missing_secrets+=("AWS_SECRET_ACCESS_KEY") | |
| [ -z "$AWS_REGION" ] && missing_secrets+=("AWS_REGION") | |
| [ -z "$AWS_S3_BUCKET_DOCS" ] && missing_secrets+=("AWS_S3_BUCKET_DOCS") | |
| [ -z "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST" ] && missing_secrets+=("AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST") | |
| [ -z "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS" ] && missing_secrets+=("AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS") | |
| if [ ${#missing_secrets[@]} -ne 0 ]; then | |
| echo "Error: The following secrets/variables are missing: ${missing_secrets[*]}" | |
| exit 1 | |
| fi | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Install and configure rclone | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rclone | |
| mkdir -p ~/.config/rclone/ | |
| cat > ~/.config/rclone/rclone.conf << EOF | |
| [docs-s3] | |
| type = s3 | |
| provider = AWS | |
| env_auth = true | |
| region = $AWS_REGION | |
| EOF | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Publish to AWS | |
| run: | | |
| if [ -n "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST" ]; then | |
| tar -xf artifacts/dnsdist-html-docs-$PDNS_VERSION/dnsdist-html-docs.tar | |
| cp artifacts/dnsdist-$PDNS_VERSION.pdf/dnsdist.pdf dnsdist-html-docs/ | |
| # Copy files to S3 | |
| echo "Copying DNSdist docs to S3..." | |
| rclone copy --checksum dnsdist-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/dnsdist.org/ | |
| # Always run invalidation | |
| echo "Running CloudFront invalidation for DNSdist..." | |
| aws cloudfront create-invalidation \ | |
| --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST \ | |
| --paths "/*" | |
| echo "Invalidation completed." | |
| fi | |
| if [ -n "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS" ]; then | |
| tar -xf artifacts/recursor-html-docs-$PDNS_VERSION/rec-html-docs.tar | |
| cp artifacts/PowerDNS-Recursor-$PDNS_VERSION.pdf/PowerDNS-Recursor.pdf rec-html-docs/ | |
| # Copy all PowerDNS docs to S3 | |
| echo "Copying Recursor docs to S3..." | |
| rclone copy --checksum rec-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/recursor/ | |
| tar -xf artifacts/authoritative-html-docs-$PDNS_VERSION/auth-html-docs.tar | |
| cp artifacts/PowerDNS-Authoritative-$PDNS_VERSION.pdf/PowerDNS-Authoritative.pdf auth-html-docs/ | |
| echo "Copying Authoritative docs to S3..." | |
| rclone copy --checksum auth-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/authoritative/ | |
| tar -xf artifacts/website-$PDNS_VERSION/website.tar | |
| echo "Copying website files to S3..." | |
| rclone copy --checksum website/docs.powerdns.com/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/ | |
| # Always run invalidation | |
| echo "Running CloudFront invalidation for PowerDNS docs..." | |
| aws cloudfront create-invalidation \ | |
| --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS \ | |
| --paths "/*" | |
| echo "Invalidation completed." | |
| fi |