1919name : Drupal
2020
2121env :
22- COMPOSE_USER : root
22+ COMPOSE_USER : runner
2323
2424on :
2525 pull_request :
@@ -33,11 +33,14 @@ jobs:
3333 name : Check that site can be installed
3434 runs-on : ubuntu-latest
3535 steps :
36- - uses : actions/checkout@v4
36+ - uses : actions/checkout@v6
3737
38- - name : Start docker and install dependencies
38+ - name : Create docker network
3939 run : |
4040 docker network create frontend
41+
42+ - name : Start docker and install dependencies
43+ run : |
4144 docker compose pull
4245 docker compose up --detach
4346
@@ -64,21 +67,41 @@ jobs:
6467 # Check updating site only on pull request.
6568 if : github.event_name == 'pull_request'
6669 name : Check that site can be updated
70+
71+ # This job checks that the Drupal site can be upgraded without issues.
72+ #
73+ # We do this by
74+ #
75+ # 1. Checking out the base branch ("github.base_ref") and installing the
76+ # site from scratch (using the exact same steps as the "install-site"
77+ # job)
78+ # 2. Checking out the updated code and updating the site from the previous
79+ # installation
80+ #
81+ # Notice that step 2 is NOT run with the code in our new branch, but with
82+ # the updated code merged on top of the target branch
83+ # (cf.https://github.com/actions/checkout/issues/881). This makes sure that
84+ # we can actually update the site after merging with the base branch.
85+ #
86+ # In some cases we run into a situation where the base site (step 1) cannot
87+ # be installed, e.g. if this is a new project or we're making changes that
88+ # require manual steps on the upgrade path, and then this jobs will fail. In
89+ # that case we should note this in the pull request description and document
90+ # the steps needed to complete the upgrade path.
91+
6792 runs-on : ubuntu-latest
68- env :
69- # Force docker compose to run with the new project name
70- # @todo Remove in the future when base branch uses the new project name
71- COMPOSE_PROJECT_NAME : deltag
72- COMPOSE_DOMAIN : deltag.local.itkdev.dk
7393 steps :
7494 # Install site from our base ref
75- - uses : actions/checkout@v4
95+ - uses : actions/checkout@v6
7696 with :
7797 ref : ${{ github.base_ref }}
7898
79- - name : Start docker and install dependencies
99+ - name : Create docker network
80100 run : |
81101 docker network create frontend
102+
103+ - name : Start docker and install dependencies
104+ run : |
82105 docker compose pull
83106 docker compose up --detach
84107
@@ -106,17 +129,15 @@ jobs:
106129 sudo chown -Rv $USER:$USER vendor/ web/ private-files/ || true
107130 sudo chmod -Rv a+w web/sites/default || true
108131
109- # Install site with our current ref
110- - uses : actions/checkout@v4
132+ # Update site using our updated code.
133+ - uses : actions/checkout@v6
111134 with :
112- ref : ${{ github.head_ref }}
113135 # Keep our local settings (cf.
114136 # https://github.com/actions/checkout?tab=readme-ov-file#usage)
115137 clean : false
116138
117139 - name : Start docker and install dependencies
118140 run : |
119- docker network create frontend || true
120141 docker compose pull
121142 docker compose up --detach
122143
0 commit comments