mirror of
https://github.com/NohamR/prometheus-qbittorrent-exporter.git
synced 2025-05-24 00:59:28 +00:00
Improved docker push github action
This commit is contained in:
parent
cb78dd1fb7
commit
723872bc15
37
.github/workflows/docker.yml
vendored
37
.github/workflows/docker.yml
vendored
@ -19,16 +19,13 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
run: |
|
||||
tag=${GITHUB_REF#refs/tags/}
|
||||
tag=${tag#refs/heads/}
|
||||
if echo $tag | grep -q -E "[0-9]+\.[0-9]+\.[0-9]+"; then
|
||||
tag="v$tag"
|
||||
fi
|
||||
echo "##[set-output name=tag;]$tag"
|
||||
id: extract_branch
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
flavor: |
|
||||
latest=auto
|
||||
images: ${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
@ -41,22 +38,26 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/386
|
||||
tags: |
|
||||
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:latest
|
||||
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:${{ steps.extract_branch.outputs.tag }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
- name: Docker meta
|
||||
id: metaghcr
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
flavor: |
|
||||
latest=auto
|
||||
images: ${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter
|
||||
|
||||
- name: Login to Github Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.GHCR_PERSONAL_TOKEN }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push docker to Github Container Registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/386
|
||||
tags: |
|
||||
ghcr.io/${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:latest
|
||||
ghcr.io/${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:${{ steps.extract_branch.outputs.tag }}
|
||||
tags: ${{ steps.metaghcr.outputs.tags }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user