diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 15e81a0df..1f5cc3c58 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,7 +10,18 @@ jobs: permissions: packages: write contents: read - + strategy: + fail-fast: false + matrix: + image: + - name: 'ubuntu:18.04' + suffix: '-ubuntu18.04' + - name: 'ubuntu:20.04' + suffix: '-ubuntu20.04' + - name: 'ubuntu:22.04' + suffix: '-ubuntu22.04' + - name: 'ubuntu:latest' + suffix: '' steps: - uses: actions/checkout@v3 @@ -35,6 +46,7 @@ jobs: uses: docker/build-push-action@v4 with: push: true - build-args: - - VERSION=${{ steps.set-version.outputs.VERSION }} - tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.set-version.outputs.VERSION }} + build-args: | + VERSION=${{ steps.set-version.outputs.VERSION }} + APP_IMAGE=${{ matrix.app_image }} + tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.set-version.outputs.VERSION }}${{ matrix.image.suffix }} diff --git a/Dockerfile b/Dockerfile index a59e92471..09b4aefc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ +ARG APP_IMAGE=ubuntu:latest + # Build FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build ARG VERSION ARG BUILD_TIME -RUN apk update -RUN apk add git - WORKDIR /file.d COPY go.mod go.sum ./ @@ -25,7 +24,7 @@ RUN go build -trimpath \ -o file.d ./cmd/file.d # Deploy -FROM ubuntu:20.04 +FROM $APP_IMAGE RUN apt update RUN apt install systemd strace tcpdump traceroute telnet iotop curl jq iputils-ping htop -y