diff --git a/.github/workflows/workflow-build-push-container-github-registry.yml b/.github/workflows/workflow-build-push-container-github-registry.yml index 3d03defa..2d9f0b11 100644 --- a/.github/workflows/workflow-build-push-container-github-registry.yml +++ b/.github/workflows/workflow-build-push-container-github-registry.yml @@ -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:$USER_TOKEN@github.com/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:$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: 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 }} @@ -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 }}