forked from EmpireProject/Empire
-
-
Notifications
You must be signed in to change notification settings - Fork 577
46 lines (44 loc) · 1.42 KB
/
dockerimage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: bcsecurity/empire:${{ steps.tag-step.outputs.RELEASE_TAG }}