Merge pull request #1673 from cal-itp/shn-typology #363
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: Update and deploy portfolio index site | |
on: | |
push: | |
branches: [main] | |
paths: | |
- '.github/workflows/update-portfolio-index.yml' | |
- 'portfolio/**' | |
workflow_dispatch: | |
env: | |
PYTHON_VERSION: '3.11' | |
POETRY_VERSION: '2.0.1' | |
SERVICE_ACCOUNT: 'github-actions-service-account@cal-itp-data-infra.iam.gserviceaccount.com' | |
WORKLOAD_IDENTITY_PROVIDER: 'projects/1005246706141/locations/global/workloadIdentityPools/github-actions/providers/analysis' | |
PROJECT_ID: 'cal-itp-data-infra' | |
ANALYSIS_BUCKET: 'calitp-analysis' | |
jobs: | |
deploy-index: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Authenticate Google Service Account | |
uses: google-github-actions/auth@v2 | |
with: | |
create_credentials_file: true | |
project_id: ${{ env.PROJECT_ID }} | |
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ env.SERVICE_ACCOUNT }} | |
- name: Setup GCloud utilities | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache Python packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: python-cache-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-${{ hashFiles('.github/workflows/*.yml') }} | |
- name: Install python packages | |
run: | | |
pip install -r portfolio/requirements.txt | |
- name: Deploy index | |
run: | | |
python portfolio/portfolio.py index --deploy |