Skip to content

Commit

Permalink
fix the release script, remove 'docker' refs
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Lombrozo <[email protected]>
  • Loading branch information
djeebus committed Jan 6, 2023
1 parent 0d0ded7 commit 1f243bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [published]

jobs:
release:
release-binaries:
runs-on: ubuntu-22.04

steps:
Expand All @@ -31,12 +31,44 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push the Docker image
- name: Build and push the binaries
run: |
earthly \
--push \
+release \
+release-binaries \
--version=${{ env.RELEASE_VERSION }} \
--commitSHA=${{ env.SHORT_SHA }}
--image_name=ghcr.io/${{ github.repository_owner }}/prom-aggregation-gateway \
--token ${{ secrets.GITHUB_TOKEN }}
release-image:
runs-on: ubuntu-22.04

steps:
- name: checkout the source code
uses: actions/checkout@v3

- uses: wistia/[email protected]

- uses: earthly/actions-setup@v1
with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" }

- name: Extract tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Extract short sha
run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV

- name: login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push the Docker image
run: |
earthly \
--push \
+build-image \
--version=${{ env.RELEASE_VERSION }} \
--commitSHA=${{ env.SHORT_SHA }} \
--image_name=ghcr.io/${{ github.repository_owner }}/prom-aggregation-gateway
6 changes: 3 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ ci-helm:
BUILD +test-helm

build:
BUILD +build-docker
BUILD +build-image
BUILD +build-helm

release:
BUILD +release-binaries
BUILD +build-docker
BUILD +build-image

go-deps:
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION}
Expand All @@ -50,7 +50,7 @@ build-binary:

SAVE ARTIFACT ./prom-aggregation-gateway

build-docker:
build-image:
FROM alpine:${ALPINE_VERSION}
COPY +build-binary/prom-aggregation-gateway .
ENV GIN_MODE=release
Expand Down

0 comments on commit 1f243bb

Please sign in to comment.