split images #16
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# https://github.com/docker/build-push-action/issues/461 | |
# https://github.com/docker/build-push-action/issues/906#issuecomment-1674567311 | |
jobs: | |
build_old: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
image-name: ["server-base", "secret-generation"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.image-name }} | |
push: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} | |
tags: ghcr.io/diracgrid/diracx/${{ matrix.image-name }}:latest | |
platforms: linux/amd64,linux/arm64 | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Enable containerd | |
run: | | |
cat /etc/docker/daemon.json | jq '. + {"experimental": true, "features": {"containerd-snapshotter": true}}' > daemon.json.new | |
sudo cp daemon.json.new /etc/docker/daemon.json | |
sudo systemctl restart docker.service | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push base | |
id: build_base | |
uses: docker/build-push-action@v5 | |
with: | |
load: true | |
context: base | |
push: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} | |
tags: ghcr.io/diracgrid/diracx/base:latest | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push services-base | |
run: | | |
echo "CHRIS digets ${{steps.build_base.outputs.digest}}" | |
echo "CHRIS image_id ${{steps.build_base.outputs.imageid}}" | |
- name: Build and push services-base | |
uses: docker/build-push-action@v5 | |
with: | |
context: services-base | |
load: true | |
push: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} | |
tags: ghcr.io/diracgrid/diracx/services-base:latest | |
platforms: linux/amd64,linux/arm64 | |
build-args: ${{steps.build_base.outputs.digest}} | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
limit-access-to-actor: true | |
- name: Build and push client-base | |
uses: docker/build-push-action@v5 | |
with: | |
context: client-base | |
load: true | |
push: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} | |
tags: ghcr.io/diracgrid/diracx/client-base:latest | |
platforms: linux/amd64,linux/arm64 | |
build-args: ${{steps.build_base.outputs.digest}} | |