chore: Update build and docker dependencies

This commit is contained in:
2022-07-16 12:41:25 +01:00
parent 6ac0db075b
commit e699b7747f
3 changed files with 11 additions and 10 deletions

View File

@@ -1,5 +1,4 @@
name: ci
name: build-docker-image
on:
push:
branches:
@@ -12,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v1
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
@@ -24,9 +23,11 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
ghcr.io/${{ github.repository_owner }}/hg612-exporter:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/hg612-exporter:latest

View File

@@ -17,11 +17,11 @@ jobs:
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1.26
- uses: wangyoucao577/go-release-action@v1.29
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.18.1.linux-amd64.tar.gz"
goversion: "https://dl.google.com/go/go1.18.4.linux-amd64.tar.gz"
binary_name: "hg612-exporter"
extra_files: LICENSE README.md

View File

@@ -1,10 +1,10 @@
FROM golang:1.18.1-alpine3.15 as build
FROM golang:1.18.4-alpine3.16 as build
WORKDIR /build
COPY . .
RUN go get -d -v .
RUN go build -v -o hg612-exporter .
FROM alpine:3.15.4
FROM alpine:3.16.0
WORKDIR /service
COPY --from=build /build/hg612-exporter .
ENTRYPOINT ["./hg612-exporter"]