mirror of
https://github.com/SpecterOps/Nemesis
synced 2026-06-08 12:36:42 +00:00
Build workflow with native runners
-Build workflow with native runners instead of Qemu
This commit is contained in:
@@ -12,16 +12,22 @@ on:
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_PREFIX: "specterops/nemesis" # ${{ github.repository }} causes issues as SpecterOps is not all lowercase
|
||||
PLATFORMS: linux/amd64,linux/arm64 # Added platforms (arm64 for Mac M1/M2/M3 and AWS images)
|
||||
|
||||
jobs:
|
||||
|
||||
### These base images never really change much, so commented out for now
|
||||
build-base-images:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-22.04
|
||||
platform: linux/amd64
|
||||
- runner: ubuntu-22.04-arm
|
||||
platform: linux/arm64
|
||||
outputs:
|
||||
python-base-dev-tag: ${{ steps.meta-python-base-dev.outputs.version }}
|
||||
python-base-prod-tag: ${{ steps.meta-python-base-prod.outputs.version }}
|
||||
@@ -30,9 +36,6 @@ jobs:
|
||||
- name: Checkout repository
|
||||
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
|
||||
|
||||
@@ -61,7 +64,7 @@ jobs:
|
||||
context: ./infra/docker/python_base
|
||||
file: ./infra/docker/python_base/dev.Dockerfile
|
||||
push: true
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.meta-python-base-dev.outputs.tags }}
|
||||
labels: ${{ steps.meta-python-base-dev.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
@@ -84,7 +87,7 @@ jobs:
|
||||
context: ./infra/docker/python_base
|
||||
file: ./infra/docker/python_base/prod.Dockerfile
|
||||
push: true
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.meta-python-base-prod.outputs.tags }}
|
||||
labels: ${{ steps.meta-python-base-prod.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
@@ -107,7 +110,7 @@ jobs:
|
||||
context: ./projects/InspectAssembly
|
||||
file: ./projects/InspectAssembly/Dockerfile
|
||||
push: true
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.meta-inspect-assembly.outputs.tags }}
|
||||
labels: ${{ steps.meta-inspect-assembly.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
@@ -115,12 +118,17 @@ jobs:
|
||||
|
||||
build-service-images:
|
||||
needs: build-base-images
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-22.04
|
||||
platform: linux/amd64
|
||||
- runner: ubuntu-22.04-arm
|
||||
platform: linux/arm64
|
||||
service:
|
||||
- name: web-api
|
||||
context: .
|
||||
@@ -159,10 +167,6 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# TODO: test if the noseyparker build takes too long for ARM
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
@@ -189,7 +193,7 @@ jobs:
|
||||
context: ${{ matrix.service.context }}
|
||||
file: ${{ matrix.service.dockerfile }}
|
||||
push: true
|
||||
platforms: ${{ env.PLATFORMS }} # TODO: test if the noseyparker build takes too long for ARM
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
|
||||
Reference in New Issue
Block a user