Skip to content

Commit

Permalink
Migrate deployment to GitHub Actions (#50)
Browse files Browse the repository at this point in the history
* Migrate deployment to GitHub Actions

* Update release workflow

* Fix typos

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
g4brielvs and pre-commit-ci[bot] committed Jun 6, 2024
1 parent 6d5bfed commit 1f254ce
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
name: Publish to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: 3.11
cache: "pip"
- name: Dependencies
- name: Install Dependencies
run: |
if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then pip install ".[docs]"; fi
- name: Build Jupyter Book
- name: Build Juputer Book Documentation
run: |
jupyter-book build . --config docs/_config.yml --toc docs/_toc.yml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main' && job.status == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
enable_jekyll: false
path: "_build/html"

deploy-book:
needs: build-book
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push
on:
push:
tags:
- '*'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

Expand Down
2 changes: 1 addition & 1 deletion notebooks/world-bank-package.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"id": "b4c0f3e8-7756-41bb-aa21-cc2eee5ff67f",
"metadata": {},
"source": [
"Unlike the [previous example](https://worldbank.github.io/template/notebooks/world-bank-api.html), where the source code was contained on the Jupyter notebok itself, we (re)use a Python package - the [template](https://github.com/worldbank/template/tree/main/src/template) Python package - which will let us (re)use any attributes and methods in the following example.\n",
"Unlike the [previous example](https://worldbank.github.io/template/notebooks/world-bank-api.html), where the source code was contained on the Jupyter notebook itself, we (re)use a Python package - the [template](https://github.com/worldbank/template/tree/main/src/template) Python package - which will let us (re)use any attributes and methods in the following example.\n",
"\n",
"Let's start by importing `WorldBankIndicatorsAPI`, a Python API wrapper class created to facilitate the usage of the [World Bank Indicators API](https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation)."
]
Expand Down

0 comments on commit 1f254ce

Please sign in to comment.