Skip to content

resync working

resync working #11

name: Build and Push Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
OSQUERY_VERSION: ${{ vars.OSQUERY_VERSION }}
OSCTRL_VERSION: ${{ vars.OSCTRL_VERSION }}
strategy:
matrix:
service:
- name: osctrl-tls
file: deploy/docker/dockerfiles/Dockerfile-dev-tls
- name: osctrl-admin
file: deploy/docker/dockerfiles/Dockerfile-dev-admin
- name: osctrl-api
file: deploy/docker/dockerfiles/Dockerfile-dev-api
- name: osctrl-cli
file: deploy/docker/dockerfiles/Dockerfile-dev-cli
- name: osctrl-osquery
file: deploy/docker/dockerfiles/Dockerfile-osquery
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: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push ${{ matrix.service.name }}
uses: docker/build-push-action@v6
with:
build-args: |
OSQUERY_VERSION=${{ env.OSQUERY_VERSION }}
OSCTRL_VERSION=${{ env.OSCTRL_VERSION }}
context: .
# The key line: specify the correct Dockerfile path from the matrix
file: ${{ matrix.service.file }}
push: true
platforms: linux/amd64,linux/arm64
# Tag each image with both "latest" and the commit SHA
tags: |
ghcr.io/portswigger-it/${{ matrix.service.name }}:latest
ghcr.io/portswigger-it/${{ matrix.service.name }}:${{ github.sha }}
# If you want build-args, add them here (example shown)
# build-args: |
# GOLANG_VERSION=1.20
# OSQUERY_VERSION=5.7.0
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max