Skip to content

Commit c7bc524

Browse files
committed
continued
1 parent 48980ad commit c7bc524

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

.github/workflows/docker_image.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
name: Build Docker Image
1+
name: Build and Publish Docker Image
22

33
on:
44
push:
55
branches:
66
- main
77
- docker
8+
tags:
9+
- 'v*'
810
pull_request:
911
branches:
1012
- main
1113

1214
jobs:
13-
build-docker-artifact:
15+
build-docker-image:
1416
runs-on: ubuntu-latest
1517

1618
steps:
@@ -22,14 +24,31 @@ jobs:
2224

2325
- name: Build Docker image
2426
run: |
25-
docker build -f docker/Dockerfile -t ppuc-config-tool:latest .
27+
docker build -f docker/Dockerfile -t config-tool:latest .
2628
2729
- name: Save Docker image to tar file
2830
run: |
29-
docker save ppuc-config-tool:latest -o ppuc-config-tool.tar
31+
docker save config-tool:latest -o config-tool.tar
3032
3133
- name: Upload Docker image artifact
3234
uses: actions/upload-artifact@v4
3335
with:
34-
name: ppuc-config-tool-image
35-
path: ppuc-config-tool.tar
36+
name: config-tool-image
37+
path: config-tool.tar
38+
39+
- name: Log in to GitHub Container Registry
40+
if: startsWith(github.ref, 'refs/tags/v')
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Tag and Push Docker image to GitHub Packages
48+
if: startsWith(github.ref, 'refs/tags/v')
49+
run: |
50+
VERSION=${GITHUB_REF#refs/tags/}
51+
docker tag config-tool:latest ghcr.io/${{ github.repository_owner }}/config-tool:${VERSION}
52+
docker tag config-tool:latest ghcr.io/${{ github.repository_owner }}/config-tool:latest
53+
docker push ghcr.io/${{ github.repository_owner }}/config-tool:${VERSION}
54+
docker push ghcr.io/${{ github.repository_owner }}/config-tool:latest

docker/entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
# Paths
5-
PERSIST_DIR=/var/www/html/drupal-persist
5+
PERSIST_DIR=/var/www/html/config-tool-data
66
DB_PATH=${PERSIST_DIR}/db/.ht.sqlite
77
DRUSH=/var/www/vendor/bin/drush
88

@@ -33,7 +33,15 @@ if [ ! -f "${DB_PATH}" ]; then
3333

3434
echo \"PPUC Config Tool installation completed.\"
3535
else
36-
echo \"Existing DB found — skipping install.\"
36+
echo \"Existing DB found - check for updates\"
37+
38+
${DRUSH} deploy
39+
40+
${DRUSH} dcdi \
41+
--folder=sites/default/files/default_content \
42+
--preserve-ids \
43+
--force-override \
44+
--yes
3745
fi
3846

3947
exec apache2-foreground

web/sites/default/settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,10 @@
861861
else if (getenv('DRUPAL_DOCKER') === '1') {
862862
$databases['default']['default'] = [
863863
'driver' => 'sqlite',
864-
'database' => '/var/www/html/drupal-persist/db/.ht.sqlite',
864+
'database' => '/var/www/html/config-tool-data/db/.ht.sqlite',
865865
];
866866

867-
$config['file_public_path'] = 'drupal-persist/files';
867+
$config['file_public_path'] = 'config-tool-data/files';
868868
}
869869

870870
/**

0 commit comments

Comments
 (0)