Skip to content

feat: Add GitHub Actions runner for Dockerfiles #1

feat: Add GitHub Actions runner for Dockerfiles

feat: Add GitHub Actions runner for Dockerfiles #1

Workflow file for this run

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