Skip to content

Commit d7601ed

Browse files
authored
Merge pull request #311 from maxulysse/improve_ci
2 parents 0861481 + f7311ca commit d7601ed

4 files changed

Lines changed: 80 additions & 31 deletions

File tree

.github/workflows/build-cv.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
11
name: build-cv
22

33
on:
4+
# Allows you to run this workflow manually from the Actions tab on GitHub.
45
workflow_dispatch:
6+
# Trigger the workflow every time you push to the `main` branch
57
push:
68
branches:
79
- main
810
paths:
911
- src/data/CV-MGarcia.tex
1012
- src/data/biblio.bib
1113

14+
# Allow one concurrent build
15+
concurrency:
16+
group: "cv"
17+
cancel-in-progress: true
18+
1219
jobs:
13-
build-cv:
20+
build:
1421
runs-on: ubuntu-latest
1522
permissions:
16-
contents: write
23+
contents: read
1724

1825
steps:
1926
- name: Checkout repository
20-
uses: actions/checkout@v4
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2128

2229
- name: Set up Java
23-
uses: actions/setup-java@v4
30+
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
2431
with:
2532
distribution: temurin
2633
java-version: "17"
@@ -35,12 +42,23 @@ jobs:
3542
- name: Compile latest CV
3643
run: nextflow run maxulysse/compile-latex -r 3.0.1 -profile docker --outdir . --github_avatar 'https://avatars.githubusercontent.com/u/1019628?s=300&v=4' --input src/data/CV-MGarcia.tex --outname CV-MGarcia-latest.pdf --biblio src/data/biblio.bib
3744

38-
- name: Commit and push to cv branch
45+
deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
51+
steps:
52+
- name: Deploy to cv branch
3953
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
4054
run: |
4155
git config --local user.email "action@github.com"
4256
git config --local user.name "GitHub Action"
4357
git checkout -B cv
4458
git add -f CV-MGarcia-latest.pdf
59+
if git diff --staged --quiet; then
60+
echo "No CV changes to commit"
61+
exit 0
62+
fi
4563
git commit -m "Update CV - $(date +%Y-%m-%d)"
4664
git push -f origin cv

.github/workflows/ci.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ci-${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1017
jobs:
1118
lint:
1219
runs-on: ubuntu-latest
1320
steps:
1421
- name: Checkout repository
15-
uses: actions/checkout@v6
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1623

1724
- name: Setup Node.js
18-
uses: actions/setup-node@v6
25+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
1926
with:
2027
node-version: '24'
2128
cache: 'npm'
@@ -33,10 +40,10 @@ jobs:
3340
runs-on: ubuntu-latest
3441
steps:
3542
- name: Checkout repository
36-
uses: actions/checkout@v6
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3744

3845
- name: Setup Node.js
39-
uses: actions/setup-node@v6
46+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
4047
with:
4148
node-version: '24'
4249
cache: 'npm'

.github/workflows/deploy.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy
22

33
on:
4-
# Trigger the workflow every time you push to the `main` branch
5-
# Using a different branch name? Replace `main` with your branch’s name
6-
push:
7-
branches: [main]
84
# Allows you to run this workflow manually from the Actions tab on GitHub.
95
workflow_dispatch:
10-
11-
# Allow this job to clone the repo and create a page deployment
12-
permissions:
13-
contents: read
14-
pages: write
15-
id-token: write
6+
# Trigger the workflow every time you push to the `main` branch
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- "src/**"
12+
- "public/**"
13+
- "astro.config.mjs"
14+
- "package.json"
15+
- "package-lock.json"
16+
- "tsconfig.json"
17+
- ".github/workflows/deploy.yml"
18+
- "!src/data/CV-MGarcia.tex"
19+
- "!src/data/biblio.bib"
1620

1721
# Allow one concurrent deployment
1822
concurrency:
@@ -22,22 +26,30 @@ concurrency:
2226
jobs:
2327
build:
2428
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
2532
steps:
2633
- name: Checkout your repository using git
27-
uses: actions/checkout@v6
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
2836
- name: Install, build, and upload your site
29-
uses: withastro/action@v6
37+
uses: withastro/action@44706356b4eb735f8b9035699eb4796241a040c4 # v6
3038
with:
3139
node-version: 24
32-
package-manager: npm@latest
40+
package-manager: npm
3341

3442
deploy:
3543
needs: build
3644
runs-on: ubuntu-latest
45+
permissions:
46+
pages: write
47+
id-token: write
3748
environment:
3849
name: github-pages
3950
url: ${{ steps.deployment.outputs.page_url }}
51+
4052
steps:
4153
- name: Deploy to GitHub Pages
4254
id: deployment
43-
uses: actions/deploy-pages@v5
55+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
[![License](https://img.shields.io/github/license/maxulysse/maxulysse.github.io.svg)](https://github.com/maxulysse/maxulysse.github.io/blob/main/LICENSE)
44
[![CI](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/ci.yml)
5+
[![build-cv](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/build-cv.yml/badge.svg)](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/build-cv.yml)
6+
[![Deploy to GitHub Pages](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/deploy.yml/badge.svg)](https://github.com/maxulysse/maxulysse.github.io/actions/workflows/deploy.yml)
57

68
Personal website built with [Astro](https://astro.build).
79

810
## Dependencies
911

10-
- [academicons](https://jpswalsh.github.io/academicons/) `1.9.6`
11-
- [Astro](https://astro.build/) `^5.2.0`
12-
- [@astrojs/rss](https://docs.astro.build/en/guides/rss/) `^4.0.1`
13-
- [Bootstrap](https://getbootstrap.com/) `5.3.8`
14-
- [Font Awesome](https://fontawesome.com/) `6.5.2`
15-
- [Prism](https://prismjs.com/) `1.29.0`
16-
- [Reveal.js](https://revealjs.com/) `5.2.1`
12+
- [Astro](https://astro.build/)
13+
- [@astrojs/rss](https://docs.astro.build/en/guides/rss/)
14+
- [Bootstrap](https://getbootstrap.com/)
15+
- [Font Awesome](https://fontawesome.com/)
16+
- [@orcid/bibtex-parse-js](https://github.com/ORCID/bibtexParseJs)
17+
- [Prism](https://prismjs.com/)
18+
- [Reveal.js](https://revealjs.com/)
19+
- [academicons](https://jpswalsh.github.io/academicons/)
1720

1821
## Inspirations
1922

@@ -66,3 +69,12 @@ src/data/ Site data (authors, social links)
6669
## Deployment
6770

6871
Deployment is handled by GitHub Actions to GitHub Pages.
72+
73+
## CV Automation
74+
75+
The CV PDF is rebuilt automatically by the [build-cv workflow](.github/workflows/build-cv.yml).
76+
Generation is done via the [maxulysse/compile-latex](https://github.com/maxulysse/compile-latex) Nextflow lightweight pipeline.
77+
78+
- Triggered on pushes to `main` when either `src/data/CV-MGarcia.tex` or `src/data/biblio.bib` changes
79+
- Can also be run on demand with `workflow_dispatch` from the GitHub Actions UI
80+
- Generates `CV-MGarcia-latest.pdf` and force-pushes it to the `cv` branch

0 commit comments

Comments
 (0)