diff --git a/.github/workflows/deploy_docs.yaml b/.github/workflows/deploy_docs.yaml deleted file mode 100644 index 50ccd49..0000000 --- a/.github/workflows/deploy_docs.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Deploy MkDocs to GitHub Pages - -on: - push: - branches: - - main - -env: - python-version: "3.10" - -jobs: - deploy-docs: - name: Deploy docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ env.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.python-version }} - - - name: Install poetry - run: make download-poetry - - - name: Set up pip cache - uses: actions/cache@v3.2.4 - with: - path: ~/.cache/pypoetry/virtualenvs - key: venv-${{ env.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} - - - name: Set Poetry Path - run: | - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - - - name: Install requirements - run: | - poetry run pip install --upgrade pip - poetry install --with docs - - - name: Deploying MkDocs documentation - run: | - poetry run mkdocs build - poetry run mkdocs gh-deploy --force diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e08b3e1..7d950e8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,42 +17,82 @@ on: push: branches: - main + - 'ci/build-doc-after-release' jobs: - CI: - uses: ./.github/workflows/ci.yaml + # CI: + # uses: ./.github/workflows/ci.yaml - Release: - runs-on: ubuntu-latest - concurrency: Release - needs: CI - permissions: - id-token: write - contents: write + # Release: + # runs-on: ubuntu-latest + # concurrency: Release + # needs: CI + # permissions: + # id-token: write + # contents: write + + # steps: + # - uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + + # - name: Python Semantic Release + # uses: python-semantic-release/python-semantic-release@master + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + + # - name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # token_format: 'access_token' + # workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider + # service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com + # - name: Install twine + # run: pip install twine keyrings.google-artifactregistry-auth + + # - name: Upload dist to Google Artifact Registry + # run: | + # python3 -m twine upload \ + # --repository-url https://europe-west1-python.pkg.dev/vertex-deployer-sandbox-3a8a/vertex-deployer \ + # --verbose \ + # dist/* + + Deploy-docs: + name: Deploy docs + runs-on: ubuntu-latest + concurrency: Deploy-docs + # needs: Release + env: + python-version: 3.10 steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Python Semantic Release - uses: python-semantic-release/python-semantic-release@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - token_format: 'access_token' - workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider - service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com - - - name: Install twine - run: pip install twine keyrings.google-artifactregistry-auth - - - name: Upload dist to Google Artifact Registry - run: | - python3 -m twine upload \ - --repository-url https://europe-west1-python.pkg.dev/vertex-deployer-sandbox-3a8a/vertex-deployer \ - --verbose \ - dist/* + - uses: actions/checkout@v3 + + - name: Set up Python ${{ env.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.python-version }} + + - name: Install poetry + run: make download-poetry + + - name: Set up pip cache + uses: actions/cache@v3.2.4 + with: + path: ~/.cache/pypoetry/virtualenvs + key: venv-${{ env.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + + - name: Set Poetry Path + run: | + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + + + - name: Install requirements + run: | + poetry run pip install --upgrade pip + poetry install --only docs + + - name: Deploying MkDocs documentation + run: | + poetry run mkdocs build + poetry run mkdocs gh-deploy --force