-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This workflow will track the semver tags and build the container image for audittail. Signed-off-by: Juan Antonio Osorio <juan.osoriorobles@eu.equinix.com>
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v** | ||
|
||
env: | ||
AUDITTAIL_IMAGE_NAME: ghcr.io/metal-toolbox/audittail | ||
|
||
jobs: | ||
container: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3.0.0 | ||
|
||
- name: Login to ghcr.io | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build container images | ||
run: | | ||
revision="$(git rev-parse "${GITHUB_REF_NAME:-HEAD}")" | ||
docker build \ | ||
-f ./images/audittail/Containerfile \ | ||
-t "${AUDITTAIL_IMAGE_NAME}:latest" \ | ||
-t "${AUDITTAIL_IMAGE_NAME}:${GITHUB_REF_NAME}" \ | ||
-t "${AUDITTAIL_IMAGE_NAME}:${revision}" \ | ||
--label "org.opencontainers.image.source=https://github.com/metal-toolbox/auditevent" \ | ||
--label "org.opencontainers.image.created=$(date --iso-8601=seconds)" \ | ||
--label "org.opencontainers.image.title=audittail" \ | ||
--label "org.opencontainers.image.revision=${revision}" \ | ||
--label "org.opencontainers.image.version=${GITHUB_REF_NAME}" \ | ||
--label "org.opencontainers.image.licenses=MIT" \ | ||
--label "org.opencontainers.image.vendor=Equinix, Inc." \ | ||
. | ||
- name: Publish Container images | ||
run: docker push "${AUDITTAIL_IMAGE_NAME}" --all-tags |