Merge pull request #96 from SchmidtDSE/update-viz-site #832
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
name: Build | |
on: [push] | |
permissions: | |
actions: read | |
contents: read | |
jobs: | |
checkPipelineCode: | |
environment: build | |
runs-on: ubuntu-latest | |
name: Check pipline code | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install checks | |
run: pip install pycodestyle pyflakes nose2 | |
- name: Install other dependencies | |
run: pip install -r requirements.txt | |
- name: Run pyflakes | |
run: pyflakes *.py | |
- name: Run pycodestyle | |
run: pycodestyle *.py | |
- name: Run unit tests | |
run: nose2 | |
checkVizCodePython: | |
environment: build | |
runs-on: ubuntu-latest | |
name: Check viz code | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install checks | |
run: pip install pycodestyle pyflakes nose2 | |
- name: Install other dependencies | |
run: pip install -r requirements.txt | |
- name: Run pyflakes | |
run: pyflakes paper/viz/*.py | |
- name: Run pycodestyle | |
run: pycodestyle paper/viz/*.py | |
- name: Update apt | |
run: sudo apt-get update | |
- name: Install zip | |
run: sudo apt-get install zip | |
- name: Install wget | |
run: sudo apt-get install wget | |
- name: Download pipeline summary outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded summary data | |
run: unzip outputs.zip | |
- name: Move downloaded summary data | |
run: mv outputs paper/outputs | |
- name: Download pipeline detailed outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded detailed data | |
run: unzip data.zip | |
- name: Move downloaded detailed data | |
run: mv data paper/viz/data | |
- name: Make font build dir | |
run: mkdir font_build | |
- name: Download font | |
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip | |
- name: Unzip font | |
run: cd font_build; unzip public-sans-v2.001 | |
- name: Make font destination | |
run: mkdir paper/viz/font | |
- name: Move font | |
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf | |
- name: Install Python deps | |
run: cd paper/viz; pip install -r requirements.txt | |
- name: Make destination | |
run: mkdir paper/img | |
- name: Render images | |
run: cd paper/viz; bash render_images.sh | |
- name: Check images | |
run: cd paper/viz; bash script/check_images.sh | |
buildPaper: | |
environment: build | |
runs-on: ubuntu-latest | |
name: Build paper | |
needs: [checkPipelineCode, checkVizCodePython] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Update apt | |
run: sudo apt-get update | |
- name: Install zip | |
run: sudo apt-get install zip | |
- name: Install wget | |
run: sudo apt-get install wget | |
- name: Download pipeline summary outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded summary data | |
run: unzip outputs.zip | |
- name: Move downloaded summary data | |
run: mv outputs paper/outputs | |
- name: Download pipeline detailed outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded detailed data | |
run: unzip data.zip | |
- name: Move downloaded detailed data | |
run: mv data paper/viz/data | |
- name: Make font build dir | |
run: mkdir font_build | |
- name: Download font | |
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip | |
- name: Unzip font | |
run: cd font_build; unzip public-sans-v2.001 | |
- name: Make font destination | |
run: mkdir paper/viz/font | |
- name: Move font | |
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf | |
- name: Install Python deps | |
run: cd paper; pip install -r requirements.txt | |
- name: Install Pandoc deps | |
run: sudo apt-get install texlive-extra-utils texlive-fonts-recommended texlive-latex-base texlive-latex-extra texlive-bibtex-extra biber | |
- name: Download Pandoc | |
run: wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb | |
- name: Install Pandoc | |
run: sudo dpkg -i pandoc-3.1.9-1-amd64.deb | |
- name: Prep file structure | |
run: mkdir paper/img | |
- name: Get static images | |
run: cd paper/img; wget --user $user --password $pass https://ag-adaptation-study.pub/archive/pipeline.png | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Patch Pandoc deps | |
run: python -m pip install --force-reinstall git+https://github.com/tomduck/pandoc-xnos@284474574f51888be75603e7d1df667a0890504d#egg=pandoc-xnos | |
- name: Add other pandoc extensions | |
run: pip install pandoc-eqnos --user | |
- name: Build paper | |
run: cd paper; bash render.sh | |
- name: Move export arxiv | |
run: mv paper/arxiv.zip arxiv.zip | |
- name: Move export arxiv_complete | |
run: mv paper/arxiv_complete.zip arxiv_complete.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: arxiv | |
path: arxiv.zip | |
if-no-files-found: error | |
- name: Upload arxiv complete | |
uses: actions/upload-artifact@v4 | |
with: | |
name: arxiv_complete | |
path: arxiv_complete.zip | |
if-no-files-found: error | |
buildDeploy: | |
environment: build | |
runs-on: ubuntu-latest | |
needs: [checkPipelineCode, checkVizCodePython] | |
name: Build deploy | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Build deploy | |
run: bash prepare_viz_deploy.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: deploy | |
path: deploy.zip | |
if-no-files-found: error | |
- name: Check build | |
run: python paper/viz/script/check_deploy.py deploy | |
buildCard: | |
environment: build | |
runs-on: ubuntu-latest | |
needs: [checkPipelineCode, checkVizCodePython] | |
name: Build social card | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install other dependencies | |
run: pip install -r requirements.txt | |
- name: Update apt | |
run: sudo apt-get update | |
- name: Install zip | |
run: sudo apt-get install zip | |
- name: Install wget | |
run: sudo apt-get install wget | |
- name: Download pipeline summary outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded summary data | |
run: unzip outputs.zip | |
- name: Move downloaded summary data | |
run: mv outputs paper/outputs | |
- name: Download pipeline detailed outputs | |
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip | |
env: | |
user: ${{ secrets.HttpUser }} | |
pass: ${{ secrets.HttpPass }} | |
- name: Unzip downloaded detailed data | |
run: unzip data.zip | |
- name: Move downloaded detailed data | |
run: mv data paper/viz/data | |
- name: Make font build dir | |
run: mkdir font_build | |
- name: Download font | |
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip | |
- name: Unzip font | |
run: cd font_build; unzip public-sans-v2.001 | |
- name: Make font destination | |
run: mkdir paper/viz/font | |
- name: Move font | |
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf | |
- name: Install Python deps | |
run: cd paper/viz; pip install -r requirements.txt | |
- name: Make destination | |
run: mkdir paper/img | |
- name: Render images | |
run: cd paper/viz; bash render_images.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: card | |
path: paper/img/map.png | |
if-no-files-found: error | |
deploy: | |
environment: deploy | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: [buildPaper, buildDeploy, buildCard] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Download deploy | |
uses: actions/download-artifact@v4 | |
with: | |
name: deploy | |
- name: Download paper | |
uses: actions/download-artifact@v4 | |
with: | |
name: arxiv | |
- name: Download card | |
uses: actions/download-artifact@v4 | |
with: | |
name: card | |
- name: Unzip deploy | |
run: unzip deploy.zip | |
- name: Unzip paper | |
run: unzip arxiv.zip | |
- name: Make destination | |
run: mkdir deploy/literature | |
- name: Move paper | |
run: mv paper_filled.pdf deploy/literature/preprint.pdf | |
- name: Make social directory | |
run: mkdir deploy/social | |
- name: Move card | |
run: mv map.png deploy/social/map.png | |
- name: Deploy | |
uses: Creepios/sftp-action@v1.0.3 | |
with: | |
host: ${{ secrets.SFTPHOST }} | |
port: 22 | |
username: ${{ secrets.SFTPUSER }} | |
password: ${{ secrets.SFTPPASSWORD }} | |
localPath: './deploy' | |
remotePath: './ag-adaptation-study.pub' |