Skip to content

Commit

Permalink
issue #63: export user site
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Feb 6, 2024
1 parent 034e497 commit f09d550
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,22 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: 3.8
cache: 'pip'

- name: Install the remove-previous-image from github.com/ai-cfia/devops inside the user-site
run: pip install git+https://$USER:[email protected]/ai-cfia/devops.git@26-as-a-devops-i-want-to-create-unit-tests-for-the-remove-previous-imagepy-script
run: python -m pip install --user git+https://$USER:[email protected]/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: Access user site-packages
run: |
USER_SITE=$(python -m site --user-site)
echo "Path to site-packages is $USER_SITE"
echo "USER_SITE=$USER_SITE" >> $GITHUB_ENV
- name: Delete the previous image (unmerged pull request)
if: github.event.pull_request.merged == false
run: python remove-previous-image/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 @@ -129,7 +134,7 @@ jobs:

- name: Delete the previous image (merged pull request)
if: github.event.pull_request.merged == true
run: python remove-previous-image/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 f09d550

Please sign in to comment.