chore: upgrade version for release #30
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
| # Deploy MkDocs + terraform-docs output to GitHub Pages. | |
| # Published URL (project site): https://dbt-labs.github.io/terraform-dbtcloud-as-yaml/ | |
| # Repo setting: Settings → Pages → Build and deployment → Source: GitHub Actions | |
| name: Deploy Documentation to Pages | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - '*.tf' | |
| - 'modules/**' | |
| - 'schemas/**' | |
| - 'topologies/**' | |
| - '.github/workflows/deploy_docs.yml' | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - '*.tf' | |
| - 'modules/**' | |
| - 'schemas/**' | |
| - 'topologies/**' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| # Default to bash | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| TERRAFORM_DOCS_VERSION: v0.20.0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 # Full history for git revision dates | |
| - name: Setup Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| cache-dependency-path: 'docs/requirements.txt' | |
| - name: Install MkDocs and dependencies | |
| run: | | |
| pip install -r docs/requirements.txt | |
| - name: Install terraform-docs | |
| run: | | |
| wget -O /tmp/terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/${TERRAFORM_DOCS_VERSION}/terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz | |
| tar -xzf /tmp/terraform-docs.tar.gz -C /tmp | |
| sudo mv /tmp/terraform-docs /usr/local/bin/ | |
| chmod +x /usr/local/bin/terraform-docs | |
| terraform-docs --version | |
| - name: Generate Terraform documentation | |
| run: make docs | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
| - name: Set MkDocs site_url for GitHub Pages | |
| run: | | |
| SITE_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" | |
| python3 -c " | |
| import re, pathlib, sys | |
| site_url = sys.argv[1] | |
| path = pathlib.Path('mkdocs.yml') | |
| text = path.read_text() | |
| text, n = re.subn(r'(?m)^site_url:.*$', f'site_url: {site_url}', text, count=1) | |
| if n != 1: | |
| sys.exit('Expected exactly one site_url line in mkdocs.yml') | |
| path.write_text(text) | |
| print(f'site_url -> {site_url}') | |
| " "$SITE_URL" | |
| - name: Build with MkDocs | |
| run: | | |
| mkdocs build --strict --site-dir ./site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
| with: | |
| path: ./site | |
| # Deployment job | |
| deploy: | |
| if: github.event_name == 'push' || github.event.pull_request.merged == true | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |