Skip to content

Commit ab28e97

Browse files
committed
Enhance GitHub Actions workflow with forced run option and update publication handling
1 parent 2e97051 commit ab28e97

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,44 @@ on:
88
branches:
99
- master
1010
workflow_dispatch:
11+
inputs:
12+
force:
13+
description: 'Set to "true" to mark this run as forced when manually triggered'
14+
required: false
15+
default: 'false'
1116

1217
jobs:
1318
build:
19+
# Skip this job on push events when the head commit message contains [skip ci]
20+
if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }}
21+
permissions:
22+
contents: write
1423
runs-on: ubuntu-latest
1524
steps:
1625
- name: Checkout code
1726
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
persist-credentials: true
1830
- name: Setup Quarto
1931
uses: quarto-dev/quarto-actions/setup@v2
32+
- name: refresh publications and commit changes
33+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.inputs.force == 'true' }}
34+
run: |
35+
dotnet fsi getcomputo-pub.fsx
36+
git config user.name "github-actions[bot]"
37+
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
# Stage the generated files (ignore errors if files missing)
39+
git add site/published.yml site/pipeline.yml site/mock-papers.yml || true
40+
# Only commit if there are staged changes
41+
if git diff --staged --quiet; then
42+
echo "No publication changes to commit"
43+
else
44+
git commit -m "Update publications from getcomputo-pub.fsx [skip ci]"
45+
# push to the branch that triggered the workflow
46+
git push origin HEAD:${{ github.ref_name }}
47+
fi
48+
2049
- name: Build site
2150
uses: quarto-dev/quarto-actions/render@v2
2251
- name: Upload artifact

_quarto.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
project:
22
type: website
33
output-dir: _site
4-
# pre-render: dotnet fsi getcomputo-pub.fsx
54
website:
65
title: COMPUTO
76
site-url: https://computo.sfds.asso.fr/

0 commit comments

Comments
 (0)