Skip to content

Commit 2b8331d

Browse files
authored
Refactor deployment workflow for GitHub Actions
Updated git checkout steps and fixed token handling.
1 parent 1e45d03 commit 2b8331d

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/deployment.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
jobs:
1616
deploy-pypi:
1717
name: PyPI deployment
18-
runs-on: "ubuntu-latest"
18+
runs-on: ubuntu-latest
1919
if: github.event_name != 'push' || github.repository == 'DIRACGrid/WebAppDIRAC'
2020
permissions:
2121
id-token: write
@@ -25,21 +25,28 @@ jobs:
2525
run:
2626
shell: bash -l {0}
2727
steps:
28-
- name: configure git
28+
# Checkout your main repository properly
29+
- name: Checkout main repository
30+
uses: actions/checkout@v5
31+
with:
32+
token: ${{ secrets.PAT != '' && secrets.PAT || github.token }}
33+
fetch-depth: 0 # get full history (so no need for "git fetch --unshallow")
34+
35+
# Configure git identity
36+
- name: Configure git
2937
run: |
30-
git fetch --prune --unshallow
3138
git config --global user.email "ci@diracgrid.org"
3239
git config --global user.name "DIRACGrid CI"
33-
- name: Checkout Main repo
34-
uses: actions/checkout@v5
35-
with:
36-
token: ${{ secrets.PAT || github.token }}
40+
41+
# Checkout the DIRAC dependency
3742
- name: Checkout DIRAC dependency
3843
uses: actions/checkout@v5
3944
with:
4045
repository: DIRACGrid/DIRAC
4146
path: ../DIRAC
42-
token: ${{ secrets.PAT || github.token }}
47+
token: ${{ secrets.PAT != '' && secrets.PAT || github.token }}
48+
49+
# Set up Python
4350
- uses: actions/setup-python@v6
4451
with:
4552
python-version: "3.11"

0 commit comments

Comments
 (0)