|
64 | 64 | # Check updating site only on pull request.
|
65 | 65 | if: github.event_name == 'pull_request'
|
66 | 66 | name: Check that site can be updated
|
| 67 | + |
| 68 | + # This job checks that the Drupal site can be upgraded without issues. |
| 69 | + # |
| 70 | + # We do this by |
| 71 | + # |
| 72 | + # 1. Checking out the base branch ("github.base_ref") and installing the |
| 73 | + # site from scratch (using the exact same steps as the "install-site" |
| 74 | + # job) |
| 75 | + # 2. Checking out the updated code and updating the site from the previous |
| 76 | + # installation |
| 77 | + # |
| 78 | + # Notice that step 2 is NOT run with the code in our new branch, but with |
| 79 | + # the updated code merged on top of the target branch |
| 80 | + # (cf.https://github.com/actions/checkout/issues/881). This makes sure that |
| 81 | + # we can actually update the site after merging with the base branch. |
| 82 | + # |
| 83 | + # In some cases we run into a situation where the base site (step 1) cannot |
| 84 | + # be installed, e.g. if this is a new project or we're making changes that |
| 85 | + # require manual steps on the upgrade path, and then this jobs will fail. In |
| 86 | + # that case we should note this in the pull request description and document |
| 87 | + # the steps needed to complete the upgrade path. |
| 88 | + |
67 | 89 | runs-on: ubuntu-latest
|
68 | 90 | steps:
|
69 | 91 | # Install site from our base ref
|
@@ -101,17 +123,15 @@ jobs:
|
101 | 123 | sudo chown -Rv $USER:$USER vendor/ web/ private-files/ || true
|
102 | 124 | sudo chmod -Rv a+w web/sites/default || true
|
103 | 125 |
|
104 |
| - # Install site with our current ref |
| 126 | + # Update site using our updated code. |
105 | 127 | - uses: actions/checkout@v4
|
106 | 128 | with:
|
107 |
| - ref: ${{ github.head_ref }} |
108 | 129 | # Keep our local settings (cf.
|
109 | 130 | # https://github.com/actions/checkout?tab=readme-ov-file#usage)
|
110 | 131 | clean: false
|
111 | 132 |
|
112 | 133 | - name: Start docker and install dependencies
|
113 | 134 | run: |
|
114 |
| - docker network create frontend || true |
115 | 135 | docker compose pull
|
116 | 136 | docker compose up --detach
|
117 | 137 |
|
|
0 commit comments