diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..38750c6 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,27 @@ +name: Docker Build + +on: + pull_request: + branches: ['**'] + paths-ignore: + - 'docs/**' + - '.gitignore' + - 'LICENSE' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docker-build: + name: Docker image builds + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Read Node version + run: echo "NODE_VERSION=$(tr -d 'v' < .nvmrc)" >> "$GITHUB_ENV" + + - name: Build production image (not pushed) + run: docker build --target production --build-arg NODE_VERSION="$NODE_VERSION" . diff --git a/terraform/repository/main.tf b/terraform/repository/main.tf index f920406..bf8990f 100644 --- a/terraform/repository/main.tf +++ b/terraform/repository/main.tf @@ -90,9 +90,10 @@ module "repository" { required_approving_review_count = 1 } - # Require branches to be up to date before merging; no hardcoded check names. + # Require branches to be up to date and the listed checks to pass before merging. required_status_checks = { - strict = true + strict = true + contexts = ["Docker image builds"] } } }