@@ -26,26 +26,26 @@ jobs:
2626 RUN_PIPELINE : ${{ vars.RUN_PIPELINE }}
2727
2828 steps :
29- # Checkout repository
29+ # Always checkout the repository first
3030 - name : Checkout repository
3131 uses : actions/checkout@v3
3232
33- # Skip push event if automatic execution is off
34- - name : Skip push event if RUN_PIPELINE=false
33+ # Skip the workflow entirely if RUN_PIPELINE=false on push events
34+ - name : Skip if RUN_PIPELINE=false
3535 if : ${{ github.event_name == 'push' && env.RUN_PIPELINE != 'true' }}
3636 run : |
37- echo "Automatic execution is disabled (RUN_PIPELINE= false). Exiting ."
37+ echo "RUN_PIPELINE is false. Skipping all steps ."
3838 exit 0
3939
40- # Pull Docker image (no cache)
41- - name : Pull BET-2026 Docker image
42- if : ${{ github.event_name == 'workflow_dispatch' || env.RUN_PIPELINE == 'true' }}
43- run : docker pull ghcr.io/pacificcommunity/bet-2026:v1.2
44-
45- # Run BET-2026 pipeline
40+ # Run the pipeline and pull Docker image only if allowed
4641 - name : Run BET-2026 pipeline
4742 if : ${{ github.event_name == 'workflow_dispatch' || env.RUN_PIPELINE == 'true' }}
4843 run : |
44+ echo "RUN_PIPELINE is true. Executing pipeline..."
45+ # Pull Docker image for consistent environment
46+ docker pull ghcr.io/pacificcommunity/bet-2026:v1.2
47+
48+ # Select the pipeline mode based on user input
4949 MODE="${{ github.event.inputs.run_mode }}"
5050 if [ "$MODE" = "plots_only" ]; then
5151 make docker-plot_sens
5858 make docker-report
5959 fi
6060
61- # Prepare release directory
61+ # Prepare files for release or GitHub Pages
6262 - name : Prepare release directory
6363 if : ${{ github.event_name == 'workflow_dispatch' || env.RUN_PIPELINE == 'true' }}
6464 run : |
@@ -74,33 +74,20 @@ jobs:
7474 with :
7575 github_token : ${{ secrets.GITHUB_TOKEN }}
7676 publish_dir : ./public
77- force : true
77+ # Remove all previous files and recreate the orphan branch
78+ force_orphan : true
79+ keep_files : false
80+ # Specify the branch for GitHub Pages
81+ publish_branch : gh-pages
7882
79- # Create a unique version tag
80- - name : Create version tag
81- if : ${{ github.event_name == 'workflow_dispatch' || env.RUN_PIPELINE == 'true' }}
82- id : tag
83- run : |
84- DATE=$(date +'%Y%m%d')
85- BASE_TAG="v${DATE}"
86- git fetch --tags
87- EXISTING_COUNT=$(git tag -l "${BASE_TAG}*" | wc -l)
88- if [ "$EXISTING_COUNT" -eq 0 ]; then
89- TAG="$BASE_TAG"
90- else
91- TAG="${BASE_TAG}-$((EXISTING_COUNT+1))"
92- fi
93- echo "tag=$TAG" >> $GITHUB_OUTPUT
94- git tag "$TAG"
95- git push origin "$TAG"
96-
97- # Create GitHub Release
83+ # Create a GitHub Release
9884 - name : Create GitHub Release
9985 if : ${{ github.event_name == 'workflow_dispatch' || env.RUN_PIPELINE == 'true' }}
10086 uses : softprops/action-gh-release@v1
10187 with :
102- tag_name : ${{ steps.tag.outputs.tag }}
103- name : BET-2026 Report ${{ steps.tag.outputs.tag }}
88+ # Use run number as a unique tag to prevent conflicts
89+ tag_name : ${{ github.run_number }}
90+ name : BET-2026 Report # ${{ github.run_number }}
10491 body : |
10592 ## BET-2026 Automated Report
10693 **Mode:** ${{ github.event.inputs.run_mode }}
@@ -115,3 +102,4 @@ jobs:
115102 plot/plots_sens.html
116103 plot/plots_grid.html
117104
105+
0 commit comments