Skip to content

Commit

Permalink
Add release workflow (#13)
Browse files Browse the repository at this point in the history
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
JAORMX authored Apr 14, 2022
1 parent 5fcfacf commit 3d71057
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 3d71057

Please sign in to comment.