Skip to content

Commit

Permalink
Update build_doc.yml
Browse files Browse the repository at this point in the history
add energy estimation to doc build-deploy workflow
  • Loading branch information
gmaze committed Jun 28, 2024
1 parent d785ec8 commit fce7711
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ jobs:
shell: bash -l {0}

steps:
- name: Energy Estimation - Initialize
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
with:
task: start-measurement
company-uuid: ${{ secrets.CARBONDB_COMPANY_UUID }}
project-uuid: ${{ secrets.CARBONDB_PROJECT_UUID }}
machine-uuid: ${{ secrets.CARBONDB_MACHINE_UUID_DOC }}
continue-on-error: true

- uses: actions/checkout@v4

# Install dependencies
Expand All @@ -55,6 +65,27 @@ jobs:
with:
path: _build/html

- name: Energy Estimation - Measure Documentation Build
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
env:
ELECTRICITY_MAPS_TOKEN: ${{ secrets.ELECTRICITY_MAPS_TOKEN }}
with:
task: get-measurement
label: 'documentation-build'
continue-on-error: true

- name: Energy Estimation - Show Results
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
env:
ELECTRICITY_MAPS_TOKEN: ${{ secrets.ELECTRICITY_MAPS_TOKEN }}
with:
task: display-results
pr-comment: false
send-data: true
continue-on-error: true

deploy:
needs: build
runs-on: ubuntu-latest
Expand All @@ -65,10 +96,40 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Energy Estimation - Initialize
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
with:
task: start-measurement
company-uuid: ${{ secrets.CARBONDB_COMPANY_UUID }}
project-uuid: ${{ secrets.CARBONDB_PROJECT_UUID }}
machine-uuid: ${{ secrets.CARBONDB_MACHINE_UUID_DOC }}
continue-on-error: true

# Deploy the book's HTML to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Energy Estimation - Measure Documentation Deploy
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
env:
ELECTRICITY_MAPS_TOKEN: ${{ secrets.ELECTRICITY_MAPS_TOKEN }}
with:
task: get-measurement
label: 'documentation-deploy'
continue-on-error: true

- name: Energy Estimation - Show Results
if: ${{matrix.os == 'ubuntu-latest'}}
uses: green-coding-solutions/[email protected]
env:
ELECTRICITY_MAPS_TOKEN: ${{ secrets.ELECTRICITY_MAPS_TOKEN }}
with:
task: display-results
pr-comment: false
send-data: true
continue-on-error: true


0 comments on commit fce7711

Please sign in to comment.