Docker jenkins-agent images build #91
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: Docker jenkins-agent images build | |
on: | |
push: | |
branches: ['*'] | |
schedule: | |
## Nightly Docker Image Rebuild (1:05am daily) | |
- cron: '5 1 * * *' | |
# ## Nightly Docker Image Rebuild (12am daily) | |
# - cron: '0 0 * * *' | |
jobs: | |
docker-jenkins-agent: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
## ref: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs | |
# max-parallel: 2 | |
matrix: | |
include: | |
- cicd-build-tools: | |
name: cicd-build-tools | |
dockerfile: image/cicd-build-tools/Dockerfile | |
context: image/cicd-build-tools | |
tags: |- | |
lj020326/cicd-build-tools:latest | |
jenkins-docker-cicd-agent: | |
name: jenkins-docker-cicd-agent | |
dockerfile: image/jenkins-cicd-agent/Dockerfile | |
context: image/jenkins-cicd-agent | |
tags: |- | |
lj020326/jenkins-docker-cicd-agent:latest | |
cicd-docker-in-docker: | |
name: cicd-docker-in-docker | |
dockerfile: image/cicd-docker-in-docker/Dockerfile | |
context: image/cicd-docker-in-docker | |
tags: |- | |
lj020326/cicd-docker-in-docker:latest | |
jenkins-dind-agent: | |
name: jenkins-dind-agent | |
dockerfile: image/jenkins-dind-agent/Dockerfile | |
context: image/jenkins-dind-agent | |
tags: |- | |
lj020326/jenkins-dind-agent:latest | |
jenkins-swarm-agent: | |
name: jenkins-swarm-agent | |
dockerfile: image/jenkins-swarm-agent/Dockerfile | |
context: image/jenkins-swarm-agent | |
tags: |- | |
lj020326/jenkins-swarm-agent:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: If the same workflow is already running from a previous commit, wait for it to finish | |
uses: ahmadnassri/action-workflow-queue@v1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Build and push ${{ matrix.cicd-build-tools.name }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.cicd-build-tools.context }} | |
file: ${{ matrix.cicd-build-tools.dockerfile }} | |
# build-args: IMAGE_REGISTRY=${{ github.repository_owner }},INTERNAL_IMAGE_BUILD=NO | |
push: true | |
tags: ${{ matrix.cicd-build-tools.tags }} | |
labels: | | |
maintainer=${{ github.repository_owner }} | |
org.opencontainers.image.vendor=${{ github.repository_owner }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Build and push ${{ matrix.jenkins-docker-cicd-agent.name }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.jenkins-docker-cicd-agent.context }} | |
file: ${{ matrix.jenkins-docker-cicd-agent.dockerfile }} | |
# build-args: IMAGE_REGISTRY=${{ github.repository_owner }} | |
push: true | |
tags: ${{ matrix.jenkins-docker-cicd-agent.tags }} | |
labels: | | |
maintainer=${{ github.repository_owner }} | |
org.opencontainers.image.vendor=${{ github.repository_owner }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Build and push ${{ matrix.cicd-docker-in-docker.name }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.cicd-docker-in-docker.context }} | |
file: ${{ matrix.cicd-docker-in-docker.dockerfile }} | |
# build-args: IMAGE_REGISTRY=${{ github.repository_owner }} | |
push: true | |
tags: ${{ matrix.cicd-docker-in-docker.tags }} | |
labels: | | |
maintainer=${{ github.repository_owner }} | |
org.opencontainers.image.vendor=${{ github.repository_owner }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Build and push ${{ matrix.jenkins-dind-agent.name }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.jenkins-dind-agent.context }} | |
file: ${{ matrix.jenkins-dind-agent.dockerfile }} | |
# build-args: IMAGE_REGISTRY=${{ github.repository_owner }} | |
push: true | |
tags: ${{ matrix.jenkins-dind-agent.tags }} | |
labels: | | |
maintainer=${{ github.repository_owner }} | |
org.opencontainers.image.vendor=${{ github.repository_owner }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Build and push ${{ matrix.jenkins-swarm-agent.name }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.jenkins-swarm-agent.context }} | |
file: ${{ matrix.jenkins-swarm-agent.dockerfile }} | |
# build-args: IMAGE_REGISTRY=${{ github.repository_owner }} | |
push: true | |
tags: ${{ matrix.jenkins-swarm-agent.tags }} | |
labels: | | |
maintainer=${{ github.repository_owner }} | |
org.opencontainers.image.vendor=${{ github.repository_owner }} | |
org.opencontainers.image.revision=${{ github.sha }} |