📦 Add base image and initial features #21
Workflow file for this run
This file contains 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: Images | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- images/** | |
permissions: {} | |
jobs: | |
detect-changes: | |
name: Detect Changes | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
outputs: | |
images: ${{ steps.detect_changes.outputs.changes }} | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Build path-filters file | |
id: build_path_filters | |
run: bash scripts/path-filter/configuration-generator.sh images | |
- name: Detect changes | |
id: detect_changes | |
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 | |
with: | |
filters: .github/path-filters/images.yml | |
build-and-test: | |
needs: [detect-changes] | |
if: ${{ needs.detect-changes.outputs.images != '[]' }} | |
name: Build and Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: ${{ fromJson(needs.detect-changes.outputs.images) }} | |
platform: [linux/amd64, linux/arm64] | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set Up Google Container Structure Test | |
id: setup_container_structure_test | |
uses: ./.github/actions/setup-container-structure-test | |
- name: Set Up QEMU | |
id: setup_qemu | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set Up Docker Buildx | |
id: setup_docker_buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Build Image | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
with: | |
file: images/${{ matrix.image }}/Dockerfile | |
context: images/${{ matrix.image }} | |
platforms: ${{ matrix.platform }} | |
load: true | |
tags: ghcr.io/ministryofjustice/devcontainer-${{ matrix.image }}:${{ github.sha }} |