Monthly meeting notes #564
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 and Deploy | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- dev | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install SSH Client (pull request previews) | |
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.FRANKLIN_PRIV_PREVIEW }} | |
- name: Install SSH Client (main) | |
if: github.event_name != 'pull_request' | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.FRANKLIN_PRIV }} | |
- name: Fix URLs for PR preview deployment (pull request previews) | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "JULIA_FRANKLIN_WEBSITE_URL=https://juliahealth.org/juliahealth.github.io-previews/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV | |
echo "JULIA_FRANKLIN_PREPATH=juliahealth.github.io-previews/previews/PR${{ github.event.number }}" >> $GITHUB_ENV | |
- run: echo $JULIA_FRANKLIN_WEBSITE_URL | |
- run: echo $JULIA_FRANKLIN_PREPATH | |
- name: Install python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
# - name: Install matplotlib | |
# run: pip install matplotlib | |
- name: Install Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
version: '1' | |
- name: Build site with Franklin.jl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: julia --project -e ' | |
import Pkg; | |
Pkg.instantiate(); | |
import NodeJS; run(`$(NodeJS.npm_cmd()) install highlight.js`); | |
include("_assets/scripts/generate_results.jl"); | |
import Franklin; | |
Franklin.optimize()' | |
- name: Deploy (pull request previews) | |
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
BRANCH: gh-pages | |
FOLDER: __site | |
REPOSITORY_NAME: JuliaHealth/juliahealth.github.io-previews | |
SSH: true | |
TARGET_FOLDER: "previews/PR${{ github.event.number }}" | |
- name: Deploy (main) | |
if: github.ref == 'refs/heads/dev' && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
BRANCH: master | |
FOLDER: __site | |
SSH: true |