-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
135 additions
and
110 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-and-cache: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} # Cache the entire build Python environment | ||
restore-keys: | | ||
build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }} | ||
build-${{ env.pythonLocation }}- | ||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Check syntax | ||
run: make test-build | ||
|
||
- name: Cache built files | ||
uses: actions/cache@v4 | ||
with: | ||
path: build/html | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} | ||
|
||
- name: Build doc | ||
run: make html |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: # triggered by Core to rebuild the documentation when code comments change | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
validate: | ||
uses: ./.github/workflows/validate.yaml | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
needs: [ validate ] # also depends on `build-and-cache` job for cached build, not repeated to avoid building twice | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Restore built files | ||
uses: actions/cache@v4 | ||
with: | ||
path: build/html | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} | ||
fail-on-cache-miss: true # depend entirely on the build step | ||
|
||
- name: Deploy built directory to openfisca.org website | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
deploy_key: ${{ secrets.OPENFISCADOTORG_DEPLOY_KEY }} | ||
publish_dir: build/html | ||
external_repository: openfisca/openfisca.org | ||
destination_dir: doc | ||
publish_branch: gh-pages | ||
user_email: [email protected] | ||
user_name: OpenFisca Bot | ||
commit_message: Publish latest changes from # will be suffixed with "openfisca/openfisca-doc@<commit_sha>" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Validate | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
|
||
check-links: | ||
runs-on: ubuntu-latest | ||
needs: [ build ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Restore built files | ||
uses: actions/cache@v4 | ||
with: | ||
path: build/html | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} | ||
fail-on-cache-miss: true # depend entirely on the build step | ||
|
||
- name: Serve doc | ||
run: make prod & | ||
|
||
- name: Check for internal dead links | ||
run: wget --retry-connrefused --waitretry=1 --spider --recursive --page-requisites http://localhost:8000 | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Lint Markdown files | ||
run: make lint |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.