Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish docker images to ghcr with release #88

Merged
merged 10 commits into from
Oct 5, 2022
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.16
fzipi marked this conversation as resolved.
Show resolved Hide resolved
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
24 changes: 23 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ builds:
- darwin
goarch:
- amd64
- arm64
fzipi marked this conversation as resolved.
Show resolved Hide resolved
archives:
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
Expand Down Expand Up @@ -46,7 +47,28 @@ changelog:
- '^test'
release:
prerelease: auto

dockers:
- image_templates:
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64"
use: buildx
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64"
use: buildx
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
docker_manifests:
- name_template: "ghcr.io/coreruleset/go-ftw:latest"
image_templates:
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64"
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64"
- name_template: "ghcr.io/coreruleset/go-ftw:{{ .Version }}"
image_templates:
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64"
- "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64"
nfpms:
- id: "ftw"
builds: ["ftw"]
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/distroless/static-debian11:debug
fzipi marked this conversation as resolved.
Show resolved Hide resolved
ENTRYPOINT ["/ftw"]
COPY ftw /