Update requirements.txt #75
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
# **************************************************************************** | |
# NOTES: | |
# | |
# In order for this to work, you must replace STAGING_ORGANISATION below | |
# with the name of your staging GitHub organisation, in line 53. | |
# You must also replace STAGING_SITE_REPOSITORY below with the name of your | |
# staging site repository. | |
# | |
# For example, if your staging organisation is "my-sdg-staging-org", and your | |
# staging site repository is "open-sdg-site-starter", then use: | |
# | |
# curl -X POST https://api.github.com/repos/my-sdg-staging-org/open-sdg-site-starter/dispatches | |
# | |
# **************************************************************************** | |
name: Deploy to staging | |
on: | |
push: | |
branches: | |
- develop | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
- name: Build data | |
run: | | |
python scripts/build_data.py | |
- name: Place public files | |
run: | | |
cp public/robots-staging.txt _site/robots.txt | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: _site | |
CLEAN: true | |
- name: Waiting 4 minutes for staging data deployment | |
run: | | |
sleep 240 | |
- name: Rebuild site | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.token }}"\ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/STAGING_ORGANISATION/STAGING_SITE_REPOSITORY/actions/workflows/deploy-to-staging.yml/dispatches \ | |
-d '{"ref":"develop"}' |