Skip to content

Commit

Permalink
build: publish container images on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ddlees committed Aug 23, 2022
1 parent f317d62 commit 820f794
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
cache: true

- name: Build
run: go build -ldflags="-s -w -X github.com/bloodhoundad/azurehound/constants.Version=`git describe --tags --exact-match 2> /dev/null || git rev-parse HEAD`"
run: 'go build -ldflags="-s -w -X github.com/bloodhoundad/azurehound/constants.Version=${{ github.ref_name }}"'
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
Expand All @@ -43,3 +43,38 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: azurehound-${{ matrix.os }}-${{ matrix.arch }}.zip

containerize:
runs-on: ubuntu-latest
permissions:
packages: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ghcr.io/bloodhoundad/azurehound
tags: |
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
- name: Build Container Image
uses: docker/build-push-action@v3
with:
context: .
build-args: VERSION=${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

0 comments on commit 820f794

Please sign in to comment.