Merge pull request #322 from CodeForPhilly/docs-screenshots-edits #7
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
| name: "Build and Deploy Docs to Firebase Hosting" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/user-docs/**" | |
| env: | |
| PROJECT_ID: "benefit-decision-toolkit-play" | |
| FIREBASE_TARGET: "bdt-docs" | |
| jobs: | |
| build-and-deploy-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # ------------------------- | |
| # Install Python & MKDocs | |
| # ------------------------- | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('docs/user-docs/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r docs/user-docs/requirements.txt | |
| - name: Build MKDocs site | |
| working-directory: docs/user-docs | |
| run: mkdocs build | |
| # ------------------------- | |
| # Install Node & Firebase CLI | |
| # ------------------------- | |
| - name: Set up Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install Firebase CLI | |
| run: npm install -g firebase-tools | |
| # ------------------------- | |
| # Authenticate to Firebase | |
| # ------------------------- | |
| - id: auth | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| workload_identity_provider: projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github | |
| service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com | |
| project_id: ${{ env.PROJECT_ID }} | |
| - name: Deploy Docs to Firebase Hosting | |
| run: firebase deploy --only hosting:${{ env.FIREBASE_TARGET }} |