Skip to content

Commit

Permalink
Build docker image in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Jenicek committed Jun 3, 2023
1 parent a9bbe48 commit 5494a60
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build static analysis tool with custom plugins
on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Log into Github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Docker build
run: |
docker build -t ghcr.io/golang-cz/static-analysis .
docker push ghcr.io/golang-cz/static-analysis
1 change: 0 additions & 1 deletion .github/workflows/main.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM golang:1.20 as builder

COPY / /golangci
WORKDIR /golangci
RUN CGO_ENABLED=1 go build -trimpath -ldflags "-s -w -X main.version=master -X main.commit=custom -X main.date=custom" -o golangci-lint ./cmd/golangci/main.go
RUN CGO_ENABLED=1 go build -buildmode=plugin -o wrap-err-checker.so ./cmd/plugin/plugin.go
RUN CGO_ENABLED=1 go build -trimpath -ldflags "-s -w -X main.version=master -X main.commit=master -X main.date=custom" -o golangci-lint ./cmd/golangci/main.go
RUN CGO_ENABLED=1 go build -trimpath -ldflags "-s -w" -buildmode=plugin -o wrap-err-checker.so ./cmd/plugin/plugin.go

# stage 2
FROM golang:1.20
Expand Down

0 comments on commit 5494a60

Please sign in to comment.