Skip to content

Commit

Permalink
release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Greer <[email protected]>
  • Loading branch information
Eric Greer committed Dec 21, 2023
1 parent aab22b4 commit cf4830d
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Extract tag name
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: cmd/kuberhealthy/Dockerfile
push: true
tags: kuberhealthy/kuberhealthy:${{ env.TAG }}
platforms: linux/amd64,linux/arm64

create-release:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit cf4830d

Please sign in to comment.