name: Generate Documentation on: [push] env: DBT_PROFILES_DIR: ./ DBT_VERSION: 1.7 PYTHON_VERSION: "3.8.x" jobs: generate-docs: runs-on: ubuntu-latest if: github.event_name == 'push' services: postgres: image: postgres env: POSTGRES_PASSWORD: postgres # Set health checks to wait until postgres has started options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: # Maps tcp port 5432 on service container to the host - 5432:5432 steps: - name: Check out uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies and run run: | pip install protobuf==4.25.3 dbt-postgres==$DBT_VERSION dbt deps dbt run - name: Generate Documentation run: dbt docs generate - name: Copy files if: github.ref == 'refs/heads/main' run: 'mkdir docs && cp target/{catalog.json,index.html,manifest.json,run_results.json} docs/' shell: bash - name: Deploy uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/main' && !env.ACT with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs