Rework integration test container #15
Workflow file for this run
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
name: integrator-image | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
changes: | |
name: Change detection | |
runs-on: ubuntu-latest | |
outputs: | |
integrator: ${{ steps.filter.outputs.integrator }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
integrator: | |
- 'docker/thehive4py-integrator/**' | |
build: | |
name: Build and push | |
needs: changes | |
if: ${{ needs.changes.outputs.integrator == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
INTEGRATOR_BUILD_CTX: docker/thehive4py-integrator | |
INTEGRATOR_IMAGE_NAME: kamforka/thehive4py-integrator | |
THEHIVE_VERSION: 5.3.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set variables | |
id: variables | |
run: | | |
echo "integrator_image_fullname=$INTEGRATOR_IMAGE_NAME:thehive-$THEHIVE_VERSION" >> "$GITHUB_OUTPUT" | |
echo "integrator_image_fullname_with_hash=$INTEGRATOR_IMAGE_NAME:thehive-$THEHIVE_VERSION-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: kamforka | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ env.INTEGRATOR_BUILD_CTX }} | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{ steps.variables.outputs.integrator_image_fullname }},${{ steps.variables.outputs.integrator_image_fullname_with_hash}} | |
build_args: | | |
THEHIVE_VERSION=${{ env.THEHIVE_VERSION }} | |
# - name: Build image | |
# env: | |
# INTEGRATOR_IMAGE_FULLNAME: ${{ steps.variables.outputs.integrator_image_fullname }} | |
# INTEGRATOR_IMAGE_FULLNAME_WITH_HASH: ${{ steps.variables.outputs.integrator_image_fullname_with_hash }} | |
# run: | | |
# docker build -t $INTEGRATOR_IMAGE_FULLNAME --build-arg THEHIVE_VERSION=$THEHIVE_VERSION $INTEGRATOR_BUILD_CTX | |
# docker build -t $INTEGRATOR_IMAGE_FULLNAME_WITH_HASH --build-arg THEHIVE_VERSION=$THEHIVE_VERSION $INTEGRATOR_BUILD_CTX | |
# - name: Push image | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
# run: | | |
# docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} | |
# docker push $INTEGRATOR_IMAGE_FULLNAME | |
# docker push $INTEGRATOR_IMAGE_FULLNAME_WITH_HASH | |
# env: | |
# INTEGRATOR_IMAGE_FULLNAME: ${{ steps.variables.outputs.integrator_image_fullname }} | |
# INTEGRATOR_IMAGE_FULLNAME_WITH_HASH: ${{ steps.variables.outputs.integrator_image_fullname_with_hash }} | |
# DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
# DOCKER_PASS: ${{ secrets.DOCKER_PASS }} |