Bump julia-actions/cache from 1 to 2 (#337) #1053
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
# Runs every month on day 1 at 17:29 UTC. | |
- cron: "29 17 1 * *" | |
jobs: | |
BuildAndDeploy: | |
runs-on: ubuntu-latest | |
permissions: | |
# Required by julia-actions/cache. | |
actions: write | |
# For the push to `gh-pages` branch. | |
contents: write | |
# For the comment in the PRs saying that the PDF is ready. | |
pull-requests: write | |
env: | |
JULIA_NUM_THREADS: "auto" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- name: Copy over the Portuguese output | |
shell: bash | |
run: | | |
git clone --branch=gh-pages https://github.com/JuliaDataScience/JuliaDataScience ~/jds | |
rm -r ~/jds/.git | |
mkdir -p _build/pt | |
cp -r ~/jds/pt _build | |
- uses: julia-actions/cache@v2 | |
- name: Install GLMakie dependencies | |
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev | |
- run: julia --color=yes --project -e 'using Pkg; Pkg.instantiate()' | |
- run: > | |
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project -e 'using JDS; JDS.build()' | |
- name: Make preview PDF available | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pdf-preview | |
path: ./_build/juliadatascience.pdf | |
retention-days: 8 | |
- name: Create a comment to say that the artifact is ready | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
The PDF was created and uploaded as an artifact. \ | |
You can find it on the GitHub Actions Summary page for the GitHub Actions Runs in this PR. | |
- name: Deploy to secondary branch | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
cname: juliadatascience.io | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force_orphan: true | |
publish_dir: ./_build/ |