Skip to content

Merge pull request #1 from Intellection/add_test_and_release_workflows #1

Merge pull request #1 from Intellection/add_test_and_release_workflows

Merge pull request #1 from Intellection/add_test_and_release_workflows #1

Workflow file for this run

name: release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
IMAGE: zappi/k8s-ttl-controller
jobs:
github:
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Version ${{ github.ref_name }}
draft: false
prerelease: false
docker-hub:
needs: github
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: TwiN/k8s-ttl-controller
ref: "v${{ github.ref_name }}"
- name: Prepare Image Metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
- 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_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build, tag, and push image to Docker Hub
uses: docker/build-push-action@v6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: linux/amd64,linux/arm64
push: true
annotations: ${{ steps.metadata.outputs.annotations }}
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
docker-hub-description:
needs: docker-hub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Description On Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE }}