Skip to content

TEST 20

TEST 20 #21

# TODO: Update to pinned versions
# TODO: check tags
name: build-and-push
on:
push:
paths:
- 'jenkins/**'
- 'dind-agent/**'
env:
IMAGE_OWNER: ${{ github.repository_owner }}
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./jenkins/Dockerfile
image: caliskanugur/jenkins-server
- dockerfile: ./dind-agent/Dockerfile
image: caliskanugur/jenkins-agent
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.IMAGE_OWNER }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}