Skip to content

Commit

Permalink
Force publish if there are modifications in base directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Jan 25, 2024
1 parent ff97be0 commit 0d9e7ac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:

- uses: actions/checkout@v2

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
base:
- 'base/**'
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
Expand All @@ -52,10 +59,15 @@ jobs:
working-directory: base

- name: Base Images > Docker Build & Push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.changes.outputs.base != 'true' }}
run: ./docker_tags.sh -p
working-directory: base

- name: Base Images > Docker Build & Push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.changes.outputs.base == 'true' }}
run: ./docker_tags.sh -p -f
working-directory: base

- name: Install dependencies
run: pip install -r requirements.txt

Expand Down
1 change: 1 addition & 0 deletions base/config_files/ps-extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [[ -n "$folder" ]]; then
fi

chown www-data:www-data -R $folder/prestashop/
# Copy all files (included .env files)
cp -n -R -T -p $folder/prestashop/ /var/www/html
else
echo "Missing folder to move"
Expand Down
9 changes: 7 additions & 2 deletions base/docker_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ else
PS_VERSIONS_FILE="$1";
fi

while getopts ":p" option; do
FORCE=false
while getopts ":fp" option; do
case $option in
p)
PUSH=true
;;
f)
FORCE=true
;;
esac
done

Expand All @@ -22,8 +26,9 @@ docker_tag_exists() {

docker_image()
{
if docker_tag_exists prestashop/base ${version}; then
if ! $FORCE && docker_tag_exists prestashop/base ${version}; then
echo "Docker Image already pushed : prestashop/base:$version"
return
else
echo "Docker build & tag : prestashop/base:$version"
id=$(echo $(docker build --quiet=true images/${version} 2>/dev/null) | awk '{print $NF}')
Expand Down

0 comments on commit 0d9e7ac

Please sign in to comment.