Skip to content

Bump docker/build-push-action from 3 to 6 #58

Bump docker/build-push-action from 3 to 6

Bump docker/build-push-action from 3 to 6 #58

Workflow file for this run

name: CI
on:
- push
- pull_request
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
- name: Run Test
run: make test
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Lint
uses: golangci/golangci-lint-action@v3
Docker:
runs-on: ubuntu-latest
needs:
- Test
- Lint
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: armsnyder/a2s-exporter
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v2
with:
username: armsnyder
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker build
if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
context: .
push: false
platforms: linux/amd64,linux/arm64
build-args: BUILD_VERSION=${{ steps.meta.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker build and push
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: BUILD_VERSION=${{ steps.meta.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Sync Docker readme
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: meeDamian/[email protected]
with:
pass: ${{ secrets.DOCKERHUB_PASSWORD }}
description: true