From c1a353e8949ccd0e1bfc7d77ac6e887cf349c341 Mon Sep 17 00:00:00 2001 From: Rory N Date: Fri, 3 May 2024 19:49:57 +0100 Subject: [PATCH] ci: add publish workflow --- .github/workflows/publish.yaml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e95064d --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,43 @@ +name: Publish + +on: + push: + tags: + - 'v*' + +jobs: + docker-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + rornic/starling-exporter + tags: | + type=semver,pattern={{version}} + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v6 + context: . + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file