Skip to content

Hotfixing Dockerfile #15

Hotfixing Dockerfile

Hotfixing Dockerfile #15

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: docker
on:
push:
tags:
- v*.**.**
jobs:
audit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Verify dependencies
run: go mod verify
- name: Build
run: go build -v ./...
- name: Run go vet
run: go vet ./...
#- name: Install staticcheck
# run: go install honnef.co/go/tools/cmd/staticcheck@latest
#- name: Run staticcheck
# run: staticcheck ./...
- name: Install golint
run: go install golang.org/x/lint/golint@latest
- name: Run golint
run: golint ./...
- name: Run tests
run: go test -race -vet=off ./...
# build:
# needs: audit
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
#
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: '1.21.0'
# check-latest: true
# architecture: x64
#
# - name: Install dependencies
# run: go get .
#
# - name: Verify dependencies
# run: go mod verify
#
# - name: Build
# run: go build -v ./...
docker-image:
needs: audit
name: create docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: pubeldev/prusa_exporter
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7