Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Build Docker Images

on:
push:
branches: [master]
paths:
- "**/Dockerfile"
- ".github/workflows/docker-build.yml"
pull_request:
branches: [master]
paths:
- "**/Dockerfile"
- ".github/workflows/docker-build.yml"
workflow_dispatch:

jobs:
build-web-servers:
name: Build Web Servers & Proxies
runs-on: ubuntu-latest
strategy:
matrix:
image:
- nginx
- nginx-geoip2
- nginx-http2
- nginx-rtmp
- haproxy
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
push: ${{ github.event_name != 'pull_request' }}
tags: voxxit/${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-databases:
name: Build Databases & Caching
runs-on: ubuntu-latest
strategy:
matrix:
image:
- pg
- redis
- memcached
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
push: ${{ github.event_name != 'pull_request' }}
tags: voxxit/${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-infrastructure:
name: Build Infrastructure & Tools
runs-on: ubuntu-latest
strategy:
matrix:
image:
- vault
- powerdns
- rsyslog
- apt-mirror
- swarm
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
push: ${{ github.event_name != 'pull_request' }}
tags: voxxit/${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-development:
name: Build Development Tools
runs-on: ubuntu-latest
strategy:
matrix:
image:
- grunt
- rails
- jq
- goaccess
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
push: ${{ github.event_name != 'pull_request' }}
tags: voxxit/${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Loading