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
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Extract branch name
|
- name: Docker meta
|
||||||
shell: bash
|
id: meta
|
||||||
run: |
|
uses: docker/metadata-action@v5
|
||||||
tag=${GITHUB_REF#refs/tags/}
|
with:
|
||||||
tag=${tag#refs/heads/}
|
flavor: |
|
||||||
if echo $tag | grep -q -E "[0-9]+\.[0-9]+\.[0-9]+"; then
|
latest=auto
|
||||||
tag="v$tag"
|
images: ${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter
|
||||||
fi
|
|
||||||
echo "##[set-output name=tag;]$tag"
|
|
||||||
id: extract_branch
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -41,22 +38,26 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64,linux/386
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:latest
|
|
||||||
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:${{ steps.extract_branch.outputs.tag }}
|
- 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
|
- name: Login to Github Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GHCR_PERSONAL_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push docker to Github Container Registry
|
- name: Build and push docker to Github Container Registry
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64,linux/386
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
tags: |
|
tags: ${{ steps.metaghcr.outputs.tags }}
|
||||||
ghcr.io/${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:latest
|
|
||||||
ghcr.io/${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:${{ steps.extract_branch.outputs.tag }}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user