diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c13242..033d9b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,37 +16,43 @@ jobs: - goarch: arm64 goos: windows steps: - - uses: actions/checkout@v3 - - uses: wangyoucao577/go-release-action@v1.37 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - goversion: "1.17" - extra_files: LICENSE README.md + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.37 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "1.17" + extra_files: LICENSE README.md build_image: name: Build and Push Docker image to Docker Hub runs-on: ubuntu-latest steps: - - name: Check out the repo - uses: actions/checkout@v2 - + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: kffl/speedbump - + - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 09932eb..e77fb41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,11 @@ FROM golang:1.17.11-alpine3.16 AS builder WORKDIR /go/src/github.com/kffl/speedbump/ COPY ./ ./ RUN go get ./ -RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o speedbump . +RUN CGO_ENABLED=0 go build -v -o speedbump . FROM alpine:3.16 WORKDIR /root/ COPY --from=builder /go/src/github.com/kffl/speedbump/speedbump . ENTRYPOINT ["/root/speedbump"] -CMD ["--help"] \ No newline at end of file +CMD ["--help"]