Skip to content

Add exporter to compose #367

Add exporter to compose

Add exporter to compose #367

Workflow file for this run

name: Docker
on: [workflow_dispatch, push]
env:
MONERO_IMAGE_NAME: monero
EXPORTER_IMAGE_NAME: monero-exporter
PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7
jobs:
check-changes:
name: Check Changes (Exporter)
runs-on: ubuntu-latest
outputs:
exporter_changed: ${{ steps.changes.outputs.exporter }}
steps:
- uses: actions/checkout@v4
- id: changes
uses: dorny/paths-filter@v3
with:
filters: |
exporter:
- 'Dockerfile.prom-exporter'
build-monero:
name: Build Monero
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
arch: [amd64, arm64, armv7]
include:
- arch: amd64
runs-on: ubuntu-latest
platform: linux/amd64
- arch: arm64
runs-on: ubuntu-24.04-arm
platform: linux/arm64
- arch: armv7
runs-on: ubuntu-24.04-arm
platform: linux/arm/v7
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
push: false
cache-from: |
type=gha,scope=monero-build-${{ matrix.arch }}
cache-to: |
type=gha,mode=max,scope=monero-build-${{ matrix.arch }}
context: .
build-exporter:
name: Build Exporter
needs: [check-changes]
if: needs.check-changes.outputs.exporter_changed == 'true'
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
arch: [amd64, arm64, armv7]
include:
- arch: amd64
runs-on: ubuntu-latest
platform: linux/amd64
- arch: arm64
runs-on: ubuntu-24.04-arm
platform: linux/arm64
- arch: armv7
runs-on: ubuntu-24.04-arm
platform: linux/arm/v7
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
push: false
file: Dockerfile.prom-exporter
cache-from: |
type=gha,scope=exporter-build-${{ matrix.arch }}
cache-to: |
type=gha,mode=max,scope=exporter-build-${{ matrix.arch }}
context: .
combine-monero:
name: Combine Monero
needs: [build-monero]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/metadata-action@v5
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/monero
docker.io/rblaine/monero
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value={{branch}},enable=${{ github.ref != format('refs/heads/{0}', 'master') }}
type=ref,event=tag
- uses: docker/build-push-action@v6
with:
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=gha,scope=monero-package
type=gha,scope=monero-build-amd64
type=gha,scope=monero-build-arm64
type=gha,scope=monero-build-armv7
cache-to: |
type=gha,mode=max,scope=monero-package
combine-exporter:
name: Combine Exporter
needs: [check-changes, build-exporter]
if: needs.check-changes.outputs.exporter_changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/metadata-action@v5
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/monero-exporter
docker.io/rblaine/monero-exporter
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value={{branch}},enable=${{ github.ref != format('refs/heads/{0}', 'master') }}
type=ref,event=tag
- uses: docker/build-push-action@v6
with:
platforms: ${{ env.PLATFORMS }}
push: true
file: Dockerfile.prom-exporter
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=gha,scope=exporter-package
type=gha,scope=exporter-build-amd64
type=gha,scope=exporter-build-arm64
type=gha,scope=exporter-build-armv7
cache-to: |
type=gha,mode=max,scope=exporter-package