Skip to content

Build and Push

Build and Push #66

Workflow file for this run

name: Build and Push
on:
push:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
listcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Verify Tool List
id: verify
run: |
diff <(
grep -- --tool-- README.md | tr '[]' ' ' |
awk '{print $4}' | sort
) <(
ls */install | xargs -n1 dirname | sort
)
toollist:
runs-on: ubuntu-latest
outputs:
tools: ${{ steps.tools.outputs.tools }}
steps:
- uses: actions/checkout@master
- name: List Tools
id: tools
run: |
(
echo -n "tools=";
cat README.md | grep -- --tool-- | grep -v -- --no-test-- | (
if [ ${{ github.event_name }} != "schedule" ]
then
grep -v -- --slow-test--
else
cat
fi
) | tr '[]' ' ' | awk '{print $4}' | jq -R . | jq -c -s .;
) >> "$GITHUB_OUTPUT"
toolcheck:
needs: toollist
strategy:
fail-fast: false
matrix:
tool: ${{ fromJSON(needs.toollist.outputs.tools) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: docker/setup-buildx-action@master
- name: Pull Base
run: |
docker pull ubuntu:noble
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Tool
run: |
NAME=$(echo ${{ matrix.tool }} | tr -cd '0-9A-Za-z-_')
EXTRA=$( grep -qE "^(featherduster|volatility|qira)$" <<< "${{ matrix.tool }}" && echo python2 || echo "" )
docker build -t ctftools/$NAME --build-arg PREINSTALL="$EXTRA ${{ matrix.tool }}" .
docker push ctftools/$NAME
docker tag ctftools/$NAME ctftools/$NAME:$(date +%Y-%m-%d)
docker push ctftools/$NAME:$(date +%Y-%m-%d)