Repository navigation
Build and deploy portfolio #35
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 portfolio | |
| # SECURITY: this workflow may later read the private org Project board via a PAT. | |
| # Never add `pull_request` or `pull_request_target` triggers here — a fork PR | |
| # would then run with access to that secret. | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: "17 6 * * *" # nightly, 06:17 UTC | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [portfolio-refresh] # fired when a board item is flagged Portfolio=Yes | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build site | |
| run: python build.py | |
| - name: Stage output | |
| run: | | |
| mkdir -p _site | |
| cp index.html _site/ | |
| if [ -d assets ]; then cp -r assets _site/; fi | |
| # Project write-ups hosted on this domain. Each is a directory of | |
| # static pages; add new ones here or they will not be deployed. | |
| for d in concept-car; do | |
| if [ -d "$d" ]; then cp -r "$d" _site/; fi | |
| done | |
| # Architecture portfolio is the landing page. The content.json build | |
| # stays live as classic.html; architecture/ is overlaid at the root. | |
| cp index.html _site/classic.html | |
| if [ -d architecture ]; then cp -r architecture/. _site/; fi | |
| - name: Verify staged output | |
| run: | | |
| test -f _site/index.html | |
| test -f _site/classic.html | |
| test -f _site/assets/arch.css | |
| for p in fcev-truck concept-car hev-openpilot zonal; do test -f "_site/$p-architecture.html"; done | |
| test -f _site/traceability.html | |
| grep -q "raengineered / architecture" _site/index.html | |
| test -f _site/concept-car/concept-car.html | |
| test -f _site/concept-car/tabs.js | |
| test -d _site/concept-car/assets | |
| echo "staged: $(find _site -type f | wc -l) files" | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |