Update dependency certifi to v2026 #438
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: Docker Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: [ 'containers/**' ] | |
| pull_request: | |
| branches: [ main ] | |
| paths: [ 'containers/**' ] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| # Gets all changed containers and initiates the build for each of them. | |
| changed-containers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: '0' | |
| - name: Get changed files | |
| id: changed_files | |
| uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 | |
| - name: List all changed files | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }} | |
| run: | | |
| for file in ${ALL_CHANGED_FILES}; do | |
| echo "$file was changed" | |
| done | |
| - name: Get all directories in containers dir that have changed files | |
| id: changed_dirs | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }} | |
| # Extracts the name of the directory from the file path and creates a unique set of directories. | |
| # If the directory isn't in the containers directory, it will be ignored. | |
| # Example: containers/app1/Dockerfile -> app1 | |
| # Outputs the list of directories to the $GITHUB_OUTPUT file in json format. | |
| # Example: ["app1", "app2"] | |
| run: | | |
| changed_dirs=() | |
| for file in ${ALL_CHANGED_FILES}; do | |
| dir=$(dirname $file) | |
| if [[ $dir == "containers"* ]]; then | |
| dir=$(echo $dir | cut -d'/' -f2) | |
| changed_dirs+=($dir) | |
| fi | |
| done | |
| changed_dirs=($(echo "${changed_dirs[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) | |
| changed_dirs=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${changed_dirs[@]}") | |
| echo "Changed directories: ${changed_dirs}" | |
| echo "changed_dirs=${changed_dirs}" >> $GITHUB_OUTPUT | |
| outputs: | |
| changed_dirs: ${{ steps.changed_dirs.outputs.changed_dirs }} | |
| # Builds the Docker images for the changed containers. | |
| build-containers: | |
| needs: changed-containers | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| if: ${{ needs.changed-containers.outputs.changed_dirs != '[]' }} | |
| strategy: | |
| matrix: | |
| container: ${{ fromJson(needs.changed-containers.outputs.changed_dirs) }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
| # Login to the registry except for pull requests | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Extract metadata (tags, labels) for Docker | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0 | |
| env: | |
| IMAGE_NAME: ${{ github.repository }}/${{ matrix.container }} | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=schedule,pattern=nightly | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=match,pattern=${{ matrix.container }}-(.*),group=1 | |
| type=sha | |
| # Build and push Docker image with Buildx (don't push on PR) | |
| - name: Build and push Docker image | |
| id: build-and-push | |
| uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0 | |
| with: | |
| context: containers/${{ matrix.container }} | |
| platforms: linux/amd64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |