Skip to content

Commit 0d9e7ac

Browse files
committed
Force publish if there are modifications in base directory
1 parent ff97be0 commit 0d9e7ac

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/publish.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ jobs:
3737

3838
- uses: actions/checkout@v2
3939

40+
- uses: dorny/paths-filter@v2
41+
id: changes
42+
with:
43+
filters: |
44+
base:
45+
- 'base/**'
46+
4047
- name: Set up Python 3.8
4148
uses: actions/setup-python@v2
4249
with:
@@ -52,10 +59,15 @@ jobs:
5259
working-directory: base
5360

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

66+
- name: Base Images > Docker Build & Push
67+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.changes.outputs.base == 'true' }}
68+
run: ./docker_tags.sh -p -f
69+
working-directory: base
70+
5971
- name: Install dependencies
6072
run: pip install -r requirements.txt
6173

base/config_files/ps-extractor.sh

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if [[ -n "$folder" ]]; then
1111
fi
1212

1313
chown www-data:www-data -R $folder/prestashop/
14+
# Copy all files (included .env files)
1415
cp -n -R -T -p $folder/prestashop/ /var/www/html
1516
else
1617
echo "Missing folder to move"

base/docker_tags.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ else
88
PS_VERSIONS_FILE="$1";
99
fi
1010

11-
while getopts ":p" option; do
11+
FORCE=false
12+
while getopts ":fp" option; do
1213
case $option in
1314
p)
1415
PUSH=true
1516
;;
17+
f)
18+
FORCE=true
19+
;;
1620
esac
1721
done
1822

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

2327
docker_image()
2428
{
25-
if docker_tag_exists prestashop/base ${version}; then
29+
if ! $FORCE && docker_tag_exists prestashop/base ${version}; then
2630
echo "Docker Image already pushed : prestashop/base:$version"
31+
return
2732
else
2833
echo "Docker build & tag : prestashop/base:$version"
2934
id=$(echo $(docker build --quiet=true images/${version} 2>/dev/null) | awk '{print $NF}')

0 commit comments

Comments
 (0)