-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f95cd30
commit 8a651cc
Showing
1 changed file
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,6 @@ env: | |
# Container registry the built container image will be pushed to | ||
REGISTRY: ghcr.io | ||
|
||
# Set the container image name to the Github repository name. (MythicAgents/apfell) | ||
AGENT_IMAGE_NAME: ${{ github.repository }} | ||
|
||
# Description label for the package in Github | ||
IMAGE_DESCRIPTION: ${{ github.repository }} container for use with Mythic | ||
|
||
|
@@ -39,7 +36,7 @@ env: | |
|
||
jobs: | ||
# Builds the base container image and pushes it to the container registry | ||
agent_build_amd: | ||
agent_build_amd_api: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -60,17 +57,32 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# the following are unique to this job | ||
- name: Lowercase the server container image name | ||
run: echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> ${GITHUB_ENV} | ||
- name: Build and push the server container image | ||
|
||
- name: Build and push the server container image (api) | ||
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images | ||
with: | ||
context: Payload_Type/sliverapi | ||
file: Payload_Type/sliverapi/Dockerfile | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/sliverapi:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/sliverapi:latest | ||
push: ${{ github.ref_type == 'tag' }} | ||
# These container metadata labels allow configuring the package in Github | ||
# packages. The source will link the package to this Github repository | ||
labels: | | ||
org.opencontainers.image.source=${{ env.IMAGE_SOURCE }} | ||
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }} | ||
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }} | ||
platforms: linux/amd64 | ||
|
||
- name: Build and push the server container image (implant) | ||
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images | ||
with: | ||
context: Payload_Type/sliverimplant | ||
file: Payload_Type/sliverimplant/Dockerfile | ||
tags: | | ||
${{ env.REGISTRY }}/sliverimplant:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/sliverimplant:latest | ||
push: ${{ github.ref_type == 'tag' }} | ||
# These container metadata labels allow configuring the package in Github | ||
# packages. The source will link the package to this Github repository | ||
|
@@ -93,23 +105,19 @@ jobs: | |
- name: Checkout the repository | ||
uses: actions/checkout@v4 # ref: https://github.com/marketplace/actions/checkout | ||
|
||
# update names to lowercase | ||
- name: Lowercase the container image name | ||
run: echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> ${GITHUB_ENV} | ||
|
||
- name: Update config.json version for sliverapi | ||
uses: jossef/[email protected] | ||
with: | ||
file: config.json | ||
field: remote_images.sliverapi | ||
value: ${{env.REGISTRY}}/${{env.AGENT_IMAGE_NAME}}:${{env.VERSION}} | ||
value: ${{env.REGISTRY}}/sliverapi:${{env.VERSION}} | ||
|
||
- name: Update config.json version for sliverimplant | ||
uses: jossef/[email protected] | ||
with: | ||
file: config.json | ||
field: remote_images.sliverimplant | ||
value: ${{env.REGISTRY}}/${{env.AGENT_IMAGE_NAME}}:${{env.VERSION}} | ||
value: ${{env.REGISTRY}}/sliverimplant:${{env.VERSION}} | ||
|
||
# Push the changes to the Dockerfile | ||
- name: Push the updated base Dockerfile image reference changes | ||
|
@@ -158,17 +166,32 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# the following are unique to this job | ||
- name: Lowercase the server container image name | ||
run: echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> ${GITHUB_ENV} | ||
- name: Build and push the server container image | ||
|
||
- name: Build and push the server container image (api) | ||
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images | ||
with: | ||
context: Payload_Type/sliverapi | ||
file: Payload_Type/sliverapi/Dockerfile | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/sliverapi:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/sliverapi:latest | ||
push: ${{ github.ref_type == 'tag' }} | ||
# These container metadata labels allow configuring the package in Github | ||
# packages. The source will link the package to this Github repository | ||
labels: | | ||
org.opencontainers.image.source=${{ env.IMAGE_SOURCE }} | ||
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }} | ||
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }} | ||
platforms: linux/arm64 | ||
|
||
- name: Build and push the server container image (implant) | ||
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images | ||
with: | ||
context: Payload_Type/sliverimplant | ||
file: Payload_Type/sliverimplant/Dockerfile | ||
tags: | | ||
${{ env.REGISTRY }}/sliverimplant:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/sliverimplant:latest | ||
push: ${{ github.ref_type == 'tag' }} | ||
# These container metadata labels allow configuring the package in Github | ||
# packages. The source will link the package to this Github repository | ||
|