Skip to content

fix: remove admin class #55

fix: remove admin class

fix: remove admin class #55

name: "[prometheus-prefect-exporter] Create release, build and push"
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*'
env:
USER: devopsiaci
REPO: prometheus-prefect-exporter
jobs:
create-tag-release:
runs-on: ubuntu-latest
if: |
github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Run Semantic Release
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
branches: |
[
'main'
]
env:
GITHUB_TOKEN: ${{ secrets.GITHB_PERSONAL_TOKEN }}
build-push:
runs-on: ubuntu-latest
if: github.ref_name != 'main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Docker image metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ${{ env.USER }}/${{ env.REPO }}
flavor: latest=true
tags: |
type=semver,pattern={{version}}
labels: |
org.opencontainers.image.title=prometheus-prefect-exporter
org.opencontainers.image.description=A Prometheus Prefect Exporter
org.opencontainers.image.vendor=DevOps IA
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Update Docker registry description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.USER }}/${{ env.REPO }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache