Redesign site with modern theme and updated dependencies #172
This file contains hidden or 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: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Julia | |
| uses: julia-actions/setup-julia@v1 | |
| with: | |
| version: '1.12' | |
| - name: Fix URLs for PR preview deployment (pull request previews) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "JULIA_FRANKLIN_PREPATH=juliagpu/previews/PR${{ github.event.number }}" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| uses: julia-actions/julia-buildpkg@master | |
| - run: julia --project -e ' | |
| using Franklin; | |
| optimize(minify=false, prerender=false);' | |
| - name: Set preview prepath | |
| # if this build is a PR build and the PR is NOT from a fork | |
| if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name | |
| run: sed -i '2 i prepath = "previews/PR'${{ github.event.number }}'"' config.md | |
| - name: Build site | |
| run: julia --project -e ' | |
| using Pkg; Pkg.instantiate(); | |
| using Franklin; | |
| optimize(minify=false, prerender=false);' | |
| - name: Deploy (preview) | |
| # if this build is a PR build and the PR is NOT from a fork | |
| 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: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BRANCH: gh-pages | |
| FOLDER: __site | |
| TARGET_FOLDER: "previews/PR${{ github.event.number }}" | |
| - name: Deploy (master) | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| uses: JamesIves/github-pages-deploy-action@releases/v3 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BRANCH: gh-pages | |
| FOLDER: __site |