Skip to content

Commit

Permalink
feat(BUX-449): change release flow to also build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Orzepowski authored and Damian Orzepowski committed Jan 11, 2024
1 parent cb4e9f3 commit 742fc57
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 118 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ node_modules/
vendor/

# Binaries for programs and plugins
dist/
gin-bin
*.exe
*.exe~
Expand Down
44 changes: 16 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
# From: https://goreleaser.com/ci/actions/#usage
name: release
name: Release
permissions:
contents: write
packages: write

env:
GO111MODULE: on

on:
push:
tags:
- '*'

permissions:
contents: write
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
with:
distribution: goreleaser
version: latest
args: release --rm-dist --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Syndicate to GoDocs
run: make godocs
release_default:
uses: bactions/workflows/.github/workflows/release-go-server.yml@main
with:
version: ${{ github.ref_name }}
os: linux
go_main_file: cmd/server/main.go
release_binaries: false
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
78 changes: 0 additions & 78 deletions .goreleaser.yml

This file was deleted.

11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,6 @@ This repository was created using [MrZ's `go-template`](https://github.com/mrz18

Releases are automatically created when you create a new [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging)!

If you want to manually make releases, please install GoReleaser:

[goreleaser](https://github.com/goreleaser/goreleaser) for easy binary or library deployment to GitHub and can be installed:

- **using make:** `make install-releaser`
- **using brew:** `brew install goreleaser`

The [.goreleaser.yml](.goreleaser.yml) file is used to configure [goreleaser](https://github.com/goreleaser/goreleaser).

<br/>

### Automatic Releases on Tag Creation (recommended)

Automatic releases via [GitHub Actions](.github/workflows/release.yml) from creating a new tag:
Expand Down
17 changes: 17 additions & 0 deletions release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9-minimal

# Set working directory
WORKDIR /app

ARG project_name
ARG TARGETPLATFORM
COPY ./dist/$TARGETPLATFORM .

ARG version
ARG tag
ENV APP_BINARY=${project_name}
ENV VERSION=${version:-develop}
ENV TAG=${tag:-master}

# Set entrypoint
ENTRYPOINT ["./$APP_BINARY"]

0 comments on commit 742fc57

Please sign in to comment.