Skip to content

Commit 2110177

Browse files
committed
🔧 Updating files to keep up with template
1 parent 2ffdd48 commit 2110177

3 files changed

Lines changed: 48 additions & 15 deletions

File tree

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = false

.github/workflows/Deploy.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,35 @@ jobs:
1414
build-and-deploy:
1515
runs-on: ubuntu-latest
1616
steps:
17+
1718
- name: Checkout
1819
uses: actions/checkout@v2
1920
with:
2021
persist-credentials: false
21-
# 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
22-
# - name: Fix URLs for PR preview deployment (pull request previews)
23-
# if: github.event_name == 'pull_request'
24-
# run: |
25-
# echo "PREVIEW_FRANKLIN_WEBSITE_URL=https://missing.netlify.app/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV
26-
# echo "PREVIEW_FRANKLIN_PREPATH=previews/PR${{ github.event.number }}" >> $GITHUB_ENV
22+
23+
- name: Fix URLs for PR preview deployment (pull request previews)
24+
if: github.event_name == 'pull_request'
25+
run: |
26+
echo "PREVIEW_FRANKLIN_WEBSITE_URL=https://understanding-the-solver-output.netlify.app/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV
27+
echo "PREVIEW_FRANKLIN_PREPATH=previews/PR${{ github.event.number }}" >> $GITHUB_ENV
28+
2729
# NOTE: Python is necessary for the pre-rendering (minification) step
2830
- name: Install python
2931
uses: actions/setup-python@v2
3032
with:
3133
python-version: '3.9'
34+
3235
# NOTE: Here you can install dependencies such as matplotlib if you use
3336
# packages such as PyPlot.
3437
# - run: pip install matplotlib
3538
- name: Install Julia
3639
uses: julia-actions/setup-julia@v1
3740
with:
3841
version: 1
42+
3943
- name: Get dependencies from jso-docs.github.io
4044
run: bash getdeps.sh
45+
4146
- name: Build
4247
env:
4348
GKSwstype: "100" #https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
@@ -46,18 +51,33 @@ jobs:
4651
using NodeJS; run(`$(npm_cmd()) install`); run(`$(npm_cmd()) run css-build`);
4752
using Franklin;
4853
optimize(prerender=false, suppress_errors=false)'
49-
# - name: Deploy (preview)
50-
# 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
51-
# uses: JamesIves/github-pages-deploy-action@releases/v3
52-
# with:
53-
# BRANCH: gh-preview # The branch where the PRs previews are stored
54-
# FOLDER: __site
55-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
# TARGET_FOLDER: "previews/PR${{ github.event.number }}" # The website preview is going to be stored in a subfolder
54+
55+
- name: Deploy (preview)
56+
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
57+
uses: JamesIves/github-pages-deploy-action@releases/v3
58+
with:
59+
BRANCH: gh-preview # The branch where the PRs previews are stored
60+
FOLDER: __site
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
TARGET_FOLDER: "previews/PR${{ github.event.number }}" # The website preview is going to be stored in a subfolder
63+
5764
- name: Deploy (main)
58-
if: github.event_name == 'push'
65+
if: github.event_name != 'pull_request'
5966
uses: JamesIves/github-pages-deploy-action@releases/v3
6067
with:
6168
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6269
BRANCH: gh-pages # Replace here the branch where your website is deployed
6370
FOLDER: __site
71+
72+
pr_comment:
73+
needs: build-and-deploy
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: 'Comment PR'
77+
uses: actions/github-script@0.3.0
78+
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
79+
with:
80+
github-token: ${{ secrets.GITHUB_TOKEN }}
81+
script: |
82+
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
83+
github.issues.createComment({ issue_number, owner, repo, body: 'Once the build has completed, you can preview your PR at this URL: https://understanding-the-solver-output.netlify.app/previews/PR${{ github.event.number }}/' });

getdeps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
wget https://github.com/jso-docs/jso-docs.github.io/archive/refs/heads/main.zip
44
unzip main.zip
55
if [ -z "$CI" ]; then
6+
rm -rf _assets _layout _libs _sass
67
mv -f jso-docs.github.io-main/{_assets,_layout,_sass,_libs,package.json,config.md,utils.jl} .
78
else
89
mv -f jso-docs.github.io-main/{_layout,_libs,_sass,package.json,config.md,utils.jl} .

0 commit comments

Comments
 (0)