prometheus-immich-exporter/.github/workflows/docker.yml

63 lines
1.9 KiB
YAML
Raw Normal View History

2020-10-23 21:49:29 +02:00
name: Docker
on:
push:
branches: [ master ]
2020-10-24 10:40:20 +02:00
release:
types: [ created ]
2020-10-23 21:49:29 +02:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v2
2020-10-24 10:30:21 +02:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
2020-10-24 10:30:21 +02:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2020-10-24 11:30:51 +02:00
2020-10-24 10:52:22 +02:00
- name: Extract branch name
shell: bash
2020-10-24 11:30:51 +02:00
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"
2020-10-24 10:52:22 +02:00
id: extract_branch
2020-10-24 10:30:21 +02:00
2020-10-23 22:02:24 +02:00
- name: Login to DockerHub
2020-10-24 10:40:20 +02:00
uses: docker/login-action@v1
2020-10-23 21:49:29 +02:00
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
2020-10-24 10:30:21 +02:00
2021-08-13 13:02:04 +02:00
- name: Build and push docker to DockerHub
2020-10-23 22:02:24 +02:00
uses: docker/build-push-action@v2
2020-10-23 22:04:10 +02:00
with:
2020-10-23 22:04:55 +02:00
push: true
platforms: linux/amd64,linux/arm64,linux/386
2021-08-13 13:02:04 +02:00
tags: |
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:latest
${{ secrets.REGISTRY_USERNAME }}/prometheus-qbittorrent-exporter:${{ steps.extract_branch.outputs.tag }}
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.GHCR_PERSONAL_TOKEN }}
- name: Build and push docker to Github Container Registry
uses: docker/build-push-action@v2
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 }}