Skip to content

Commit

Permalink
issue #63: python user-site
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Feb 6, 2024
1 parent 2c8de9a commit e5e8277
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,20 @@ jobs:
with:
python-version: 3.8

- name: Install the remove-previous-image from github.com/ai-cfia/devops
- name: Install the remove-previous-image from github.com/ai-cfia/devops inside the user-site
run: python -m pip install --user git+https://$USER:$USER_TOKEN@github.com/ai-cfia/devops.git@26-as-a-devops-i-want-to-create-unit-tests-for-the-remove-previous-imagepy-script
env:
USER: ${{ secrets.USER }}
USER_TOKEN: ${{ secrets.USER_TOKEN }}

- name: Check which site python is on
run: python -m site
- name: Access user site-packages
run: |
USER_SITE=$(python -m site --user-site)
echo "Path to site-packages is $USER_SITE"
- name: Delete the previous image (unmerged pull request)
if: github.event.pull_request.merged == false
run: python remove_previous_image.py
run: python $USER_SITE/remove-previous-image/remove_previous_image.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY: ${{ inputs.registry }}
Expand All @@ -131,7 +133,7 @@ jobs:

- name: Delete the previous image (merged pull request)
if: github.event.pull_request.merged == true
run: python remove_previous_image.py
run: python $USER_SITE/remove-previous-image/remove_previous_image.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY: ${{ inputs.registry }}
Expand Down

0 comments on commit e5e8277

Please sign in to comment.