Merge pull request #821 from markstos/patch-1 #226
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
# ------------------------------------------------------------------------------ | |
# GitHub Actions scripts | |
# Copyright(c) pgRouting Contributors | |
# | |
# Main configuration | |
# ------------------------------------------------------------------------------ | |
name: Deploy GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
if: ${{ github.repository_owner == 'OSGeo' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: | | |
sudo apt-get install cmake cpanminus | |
sudo cpanm Text::SimpleTable::AutoWidth | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r ./requirements.txt | |
- name: Initialize mandatory git config | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Build pages | |
run: | | |
mkdir -p build | |
bash ci/build-pages.sh | |
- name: Deploy pages | |
if: github.ref == 'refs/heads/master' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/_build/html | |
- name: Update locale | |
if: github.ref == 'refs/heads/master' | |
run: | | |
mkdir -p build | |
bash tools/transifex/update_locale.sh | |
# Add the files, commit and push | |
for line in `cat build/doc/locale_changes_po_pot.txt`; do git add "$line"; done | |
git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}" | |
git fetch origin master | |
git restore . # Remove the unstaged changes before rebasing | |
git rebase origin/master | |
git push origin master |