Merge pull request #721 from BC-SECURITY/release/5.9.3 #463
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: Docker Image CI | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
build: | |
if: ${{ github.repository == 'BC-SECURITY/Empire' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- 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: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get tag names | |
id: tag-step | |
run: | | |
# If this is a release, the tag will be the same as the release tag | |
# If this is a push to main, the tag will be latest | |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
echo "Using release tag ${GITHUB_REF#refs/tags/}" | |
elif [[ "$GITHUB_REF" == refs/heads/main ]]; then | |
echo "RELEASE_TAG=latest" >> "$GITHUB_OUTPUT" | |
echo "Using latest tag" | |
fi | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: bcsecurity/empire:${{ steps.tag-step.outputs.RELEASE_TAG }} |