Fix finances section (#87) #1215
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
| # Deploy the documentation to GH pages automatically. | |
| # ref: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/ | |
| name: Deploy static content to Pages | |
| on: | |
| push: | |
| branches: ["main"] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Run every day to get the latest data | |
| schedule: | |
| - cron: '0 1 * * *' | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| # Single deploy job since we're just deploying | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| # Need to use 3.13 or we hit an AST bug with the sphinx_theme_builder | |
| python-version: '3.13.x' | |
| - uses: hynek/setup-cached-uv@v2 | |
| - uses: actions/setup-node@v2 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v2 | |
| # Install dependencies | |
| - name: Install Python dependencies with uv | |
| run: uv pip install -r requirements.txt --system | |
| - name: Install nox | |
| run: uv pip install nox --system | |
| # This lets us encrypt a page with a password | |
| - name: Install staticrypt | |
| run: | | |
| npm install -g staticrypt | |
| # Download the latest data for dashboards | |
| - name: Download dashboard data | |
| run: nox -s data | |
| env: | |
| AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
| HUBSPOT_ACCESS_TOKEN: ${{ secrets.HUBSPOT_ACCESS_TOKEN }} | |
| GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }} | |
| # Build the site | |
| - name: Build the Sphinx site | |
| run: nox -s docs | |
| env: | |
| AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
| HUBSPOT_ACCESS_TOKEN: ${{ secrets.HUBSPOT_ACCESS_TOKEN }} | |
| GH_TOKEN: ${{ secrets.TOKEN_GITHUB_API_READONLY }} | |
| TOKEN_GITHUB_READONLY: ${{ secrets.TOKEN_GITHUB_API_READONLY }} | |
| # Upload artifact for looking at later | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| # Upload entire build output | |
| name: pre-encrypted-website | |
| path: 'book/_build/' | |
| # Encrypt pages that are only meant for team consumption | |
| - name: Encrypt some pages | |
| run: | | |
| if [ -f book/_build/dirhtml/people/index.html ]; then | |
| staticrypt book/_build/dirhtml/people/index.html -p ${{ secrets.STATICRYPT_PASSWORD }} -d book/_build/dirhtml/people/ --short --template-color-primary "#1D4EF5" --template-title "Only for the 2i2c team!" --template-instructions "Check the team BitWarden for the password..."; | |
| else | |
| echo "Skipping people encryption; missing book/_build/dirhtml/people/index.html" | |
| fi | |
| if [ -f book/_build/dirhtml/finances/index.html ]; then | |
| staticrypt book/_build/dirhtml/finances/index.html -p ${{ secrets.STATICRYPT_PASSWORD }} -d book/_build/dirhtml/finances/ --short --template-color-primary "#1D4EF5" --template-title "Only for the 2i2c team!" --template-instructions "Check the team BitWarden for the password..."; | |
| else | |
| echo "Skipping finances encryption; missing book/_build/dirhtml/finances/index.html" | |
| fi | |
| # Upload artifact for looking at later | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| # Upload entire build output | |
| name: encrypted-website | |
| path: 'book/_build/' | |
| # Upload to GH Pages | |
| - name: Upload artifact for GH pages | |
| uses: actions/upload-pages-artifact@v3 | |
| if: always() | |
| with: | |
| # Upload the HTML folder | |
| path: 'book/_build/dirhtml' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Upload Logs and Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sphinx-logs | |
| path: book/_build |