Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating files to keep up with template #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
52 changes: 36 additions & 16 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,35 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
# To have a preview you need to set up a netlify domain and to have access to the repo, so it can't be done automatically
# - name: Fix URLs for PR preview deployment (pull request previews)
# if: github.event_name == 'pull_request'
# run: |
# echo "PREVIEW_FRANKLIN_WEBSITE_URL=https://missing.netlify.app/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV
# echo "PREVIEW_FRANKLIN_PREPATH=previews/PR${{ github.event.number }}" >> $GITHUB_ENV

- name: Fix URLs for PR preview deployment (pull request previews)
if: github.event_name == 'pull_request'
run: |
echo "PREVIEW_FRANKLIN_WEBSITE_URL=https://BundleAdjustmentModels-tuto.netlify.app/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV
echo "PREVIEW_FRANKLIN_PREPATH=previews/PR${{ github.event.number }}" >> $GITHUB_ENV

# NOTE: Python is necessary for the pre-rendering (minification) step
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.9'

# NOTE: Here you can install dependencies such as matplotlib if you use
# packages such as PyPlot.
# - run: pip install matplotlib
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: 1
- name: Get dependencies from jso-docs.github.io

- name: Get dependencies from JuliaSmoothOptimizers.github.io
run: bash getdeps.sh

- name: Build
env:
GKSwstype: "100" #https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
Expand All @@ -46,18 +51,33 @@ jobs:
using NodeJS; run(`$(npm_cmd()) install`); run(`$(npm_cmd()) run css-build`);
using Franklin;
optimize(prerender=false, suppress_errors=false)'
# - name: Deploy (preview)
# if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this build is a PR build and the PR is NOT from a fork
# uses: JamesIves/github-pages-deploy-action@releases/v3
# with:
# BRANCH: gh-preview # The branch where the PRs previews are stored
# FOLDER: __site
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TARGET_FOLDER: "previews/PR${{ github.event.number }}" # The website preview is going to be stored in a subfolder

- name: Deploy (preview)
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this build is a PR build and the PR is NOT from a fork
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
BRANCH: gh-preview # The branch where the PRs previews are stored
FOLDER: __site
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_FOLDER: "previews/PR${{ github.event.number }}" # The website preview is going to be stored in a subfolder

- name: Deploy (main)
if: github.event_name == 'push'
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # Replace here the branch where your website is deployed
FOLDER: __site

pr_comment:
needs: build-and-deploy
runs-on: ubuntu-latest
steps:
- name: 'Comment PR'
uses: actions/[email protected]
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this is a pull request build AND the pull request is NOT made from a fork
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: 'Once the build has completed, you can preview your PR at this URL: https://BundleAdjustmentModels-tuto.netlify.app/previews/PR${{ github.event.number }}/' });
11 changes: 6 additions & 5 deletions getdeps.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
# Script to clone the jso-docs main repo and get the necessary folders
wget https://github.com/jso-docs/jso-docs.github.io/archive/refs/heads/main.zip
# Script to clone the JuliaSmoothOptimizers main repo and get the necessary folders
wget https://github.com/JuliaSmoothOptimizers/JuliaSmoothOptimizers.github.io/archive/refs/heads/main.zip
unzip main.zip
if [ -z "$CI" ]; then
mv -f jso-docs.github.io-main/{_assets,_layout,_sass,_libs,package.json,config.md,utils.jl} .
rm -rf _assets _layout _libs _sass
mv -f JuliaSmoothOptimizers.github.io-main/{_assets,_layout,_sass,_libs,package.json,config.md,utils.jl} .
else
mv -f jso-docs.github.io-main/{_layout,_libs,_sass,package.json,config.md,utils.jl} .
mv -f JuliaSmoothOptimizers.github.io-main/{_layout,_libs,_sass,package.json,config.md,utils.jl} .
fi
rm -rf jso-docs.github.io-main main.zip
rm -rf JuliaSmoothOptimizers.github.io-main main.zip