fix: convert from long RUN statements to a setup.sh script
#42
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check the Docker image builds for a PR | |
| on: | |
| pull_request: | |
| jobs: | |
| lint_dockerfile: | |
| name: Lint Dockerfile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout github repository | |
| uses: actions/checkout@v6 | |
| - | |
| name: Lint Dockerfile with hadolint | |
| uses: hadolint/hadolint-action@v3.3.0 | |
| with: | |
| dockerfile: Dockerfile | |
| lint_shell_scripts: | |
| name: Lint shell scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout github repository | |
| uses: actions/checkout@v6 | |
| - | |
| name: Install shell lint tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck shfmt | |
| - | |
| name: Run shellcheck | |
| run: | | |
| set -euo pipefail | |
| mapfile -t scripts < <(git ls-files '*.sh') | |
| shellcheck --severity style "${scripts[@]}" | |
| - | |
| name: Run shfmt | |
| run: | | |
| set -euo pipefail | |
| mapfile -t scripts < <(git ls-files '*.sh') | |
| shfmt -d -i 4 -ci "${scripts[@]}" | |
| check_build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout github repository | |
| uses: actions/checkout@v6 | |
| - | |
| name: Setup Docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - | |
| name: Set pull request build arguments | |
| id: pr_meta | |
| run: | | |
| appGitRef=develop | |
| appAddSha=true | |
| echo "appGitRef=$appGitRef" >> "$GITHUB_OUTPUT" | |
| echo "appAddSha=$appAddSha" >> "$GITHUB_OUTPUT" | |
| - | |
| name: Build Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| build-args: | | |
| VERSION_PHP=8.4 | |
| VERSION_COMPOSER=lts | |
| APP_GH_REF=${{ steps.pr_meta.outputs.appGitRef }} | |
| APP_GH_ADD_SHA=${{ steps.pr_meta.outputs.appAddSha }} | |
| load: false | |
| push: false |