-
Notifications
You must be signed in to change notification settings - Fork 6
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
6 changed files
with
122 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Build | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ main, feature/dev-site ] | ||
|
||
jobs: | ||
build: | ||
|
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 |
---|---|---|
|
@@ -76,7 +76,10 @@ jobs: | |
run: npm run build | ||
- name: Commit documentation changes | ||
run: | | ||
cd landing/build | ||
git clone --depth=1 --branch=gh-pages https://github.com/IMMM-SFA/msd_uncertainty_ebook.git previous_deploy | ||
mkdir ./landing/build/dev | ||
cp -r ./previous_deploy/dev/* ./landing/build/dev/ | ||
cd ./landing/build | ||
git init | ||
git add -A | ||
git config --local user.email "[email protected]" | ||
|
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,91 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [ feature/dev-site ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install latex dependencies | ||
run: sudo apt-get update -y && sudo apt-get install -y texlive latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended ghostscript | ||
- name: Update pip and install python dependencies | ||
working-directory: 'docs/' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Build html and pdf ebook | ||
working-directory: 'docs/' | ||
env: | ||
NODE_ENV: development | ||
run: | | ||
make html latexpdf --keep-going LATEXMKOPTS="-interaction=nonstopmode" || true | ||
make latexpdf --keep-going LATEXMKOPTS="-interaction=nonstopmode" || true | ||
make latexpdf --keep-going LATEXMKOPTS="-interaction=nonstopmode" || true | ||
continue-on-error: true | ||
- name: Concatenate eBook cover with eBook | ||
run: | | ||
mv docs/build/latex/addressinguncertaintyinmultisectordynamicsresearch.pdf docs/build/latex/ebook_content.pdf | ||
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=docs/build/latex/addressinguncertaintyinmultisectordynamicsresearch.pdf -dBATCH docs/ebook_cover.pdf docs/build/latex/ebook_content.pdf | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
cache-dependency-path: landing/package-lock.json | ||
- uses: jakejarvis/s3-sync-action@master | ||
with: | ||
args: --delete | ||
env: | ||
SOURCE_DIR: 'notebooks' | ||
DEST_DIR: 'notebooks' | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_DEV }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} | ||
AWS_REGION: ${{ secrets.AWS_REGION_DEV }} | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
file: Dockerfile_dev | ||
push: true | ||
tags: thurber/uc-ebook.org:dev | ||
- name: Install landing page dependencies | ||
working-directory: 'landing/' | ||
run: npm install | ||
- name: Build landing page | ||
working-directory: 'landing/' | ||
env: | ||
NODE_ENV: development | ||
VITE_PDF_URL: https://uc-ebook.org/dev/images/addressinguncertaintyinmultisectordynamicsresearch.pdf | ||
run: npm run build | ||
- name: Commit documentation changes | ||
run: | | ||
git clone --depth=1 --branch=gh-pages https://github.com/IMMM-SFA/msd_uncertainty_ebook.git deploy | ||
rm -rf ./deploy/.git | ||
rm -rf ./deploy/dev | ||
mkdir ./deploy/dev | ||
cp -r ./landing/build/* ./deploy/dev/ | ||
cp ./docs/build/latex/addressinguncertaintyinmultisectordynamicsresearch.pdf ./deploy/dev/images/ | ||
cd ./deploy | ||
git init | ||
git add -A | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m 'deploy' -a || true | ||
- name: Push changes to gh-pages | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages-test | ||
directory: deploy | ||
force: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,13 @@ | ||
FROM jupyter/minimal-notebook:2022-05-03 | ||
|
||
USER root | ||
|
||
RUN git clone --depth=1 --branch=feature/dev-site https://github.com/IMMM-SFA/msd_uncertainty_ebook.git msd_uncertainty_ebook | ||
RUN cd msd_uncertainty_ebook && pip install . | ||
|
||
# Now create a symlinked data folder inside the msdbook package that links to /home/demo/data folder | ||
RUN mkdir -p /home/demo/data | ||
RUN rm -rf /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
RUN ln -s /home/demo/data /opt/conda/lib/python3.9/site-packages/msdbook/data | ||
|
||
|
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