Update ubuntu Docker tag to noble-20240801 #1820
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: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-amd64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build to export cache | |
uses: docker/bake-action@v5 | |
with: | |
set: | | |
devcontainer.cache-from=type=gha,scope=devcontainer-amd64 | |
jenkins-agent-dind.cache-from=type=gha,scope=jenkins-agent-dind-amd64 | |
devcontainer.cache-to=type=gha,scope=devcontainer-amd64,mode=max | |
jenkins-agent-dind.cache-to=type=gha,scope=jenkins-agent-dind-amd64,mode=max | |
build-arm64: | |
runs-on: ubuntu-latest | |
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: Build to export cache | |
uses: docker/bake-action@v5 | |
with: | |
set: | | |
devcontainer.platform=linux/arm64 | |
jenkins-agent-dind.platform=linux/arm64 | |
devcontainer.cache-from=type=gha,scope=devcontainer-arm64 | |
jenkins-agent-dind.cache-from=type=gha,scope=jenkins-agent-dind-arm64 | |
devcontainer.cache-to=type=gha,scope=devcontainer-arm64,mode=max | |
jenkins-agent-dind.cache-to=type=gha,scope=jenkins-agent-dind-arm64,mode=max | |
test: | |
needs: build-amd64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
# Needed for jenkins-agent-dind/test.sh | |
driver-opts: network=host | |
- name: Build to import cache | |
uses: docker/bake-action@v5 | |
with: | |
set: | | |
devcontainer.cache-from=type=gha,scope=devcontainer-amd64 | |
jenkins-agent-dind.cache-from=type=gha,scope=jenkins-agent-dind-amd64 | |
load: true | |
- name: Test | |
uses: devcontainers/[email protected] | |
with: | |
runCmd: ./test.sh | |
push: | |
needs: | |
- build-arm64 | |
- test | |
runs-on: ubuntu-latest | |
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: Docker meta (devcontainer) | |
id: docker-meta-devcontainer | |
uses: docker/metadata-action@v5 | |
env: | |
DOCKER_METADATA_ANNOTATIONS_LEVELS: index | |
with: | |
bake-target: devcontainer | |
images: | | |
ghcr.io/${{ github.repository_owner }}/devcontainer | |
labels: | | |
org.opencontainers.image.title=Devcontainer | |
org.opencontainers.image.description=A multi-purpose Docker on Docker or Docker in Docker image to be used as a Devcontainer. | |
annotations: | | |
org.opencontainers.image.title=Devcontainer | |
org.opencontainers.image.description=A multi-purpose Docker on Docker or Docker in Docker image to be used as a Devcontainer. | |
flavor: | | |
latest=false | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha,enable=${{ github.event_name == 'push' }} | |
type=raw,value=2,enable=${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
type=raw,value=latest,enable=${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
- name: Docker meta (jenkins-agent-dind) | |
id: docker-meta-jenkins-agent-dind | |
uses: docker/metadata-action@v5 | |
env: | |
DOCKER_METADATA_ANNOTATIONS_LEVELS: index | |
with: | |
bake-target: jenkins-agent-dind | |
images: | | |
ghcr.io/${{ github.repository_owner }}/jenkins-agent-dind | |
labels: | | |
org.opencontainers.image.title=Jenkins Agent with Docker in Docker | |
org.opencontainers.image.description=A Docker in Docker image to provide fully ephemeral Jenkins agents. | |
annotations: | | |
org.opencontainers.image.title=Jenkins Agent with Docker in Docker | |
org.opencontainers.image.description=A Docker in Docker image to provide fully ephemeral Jenkins agents. | |
flavor: | | |
latest=false | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha,enable=${{ github.event_name == 'push' }} | |
type=raw,value=2,enable=${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
type=raw,value=latest,enable=${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push | |
uses: docker/bake-action@v5 | |
with: | |
files: | | |
./docker-bake.hcl | |
${{ steps.docker-meta-devcontainer.outputs.bake-file }} | |
${{ steps.docker-meta-devcontainer.outputs.bake-file-annotations }} | |
${{ steps.docker-meta-jenkins-agent-dind.outputs.bake-file }} | |
${{ steps.docker-meta-jenkins-agent-dind.outputs.bake-file-annotations }} | |
set: | | |
devcontainer.platform=linux/amd64,linux/arm64 | |
jenkins-agent-dind.platform=linux/amd64,linux/arm64 | |
devcontainer.cache-from=type=gha,scope=devcontainer-amd64 | |
devcontainer.cache-from=type=gha,scope=devcontainer-arm64 | |
jenkins-agent-dind.cache-from=type=gha,scope=jenkins-agent-dind-amd64 | |
jenkins-agent-dind.cache-from=type=gha,scope=jenkins-agent-dind-arm64 | |
push: true |