Skip to content

Commit

Permalink
Add an epic-gateway CI action
Browse files Browse the repository at this point in the history
Signed-off-by: Toby Cabot <[email protected]>
  • Loading branch information
caboteria committed Sep 13, 2023
1 parent 0449dd6 commit 46e8001
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/epic-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with: {go-version: '=1.19.8'}

- name: Export release name
run: |
NEW_RELEASE=${{ github.ref_name }}
# if we're building from a branch (i.e., not a tag) then add
# the short sha so we can have more than one build per branch
if [[ ${{ github.ref }} != refs/tags/* ]]; then
NEW_RELEASE=${NEW_RELEASE}-$(git rev-parse --short HEAD)
fi
echo $NEW_RELEASE
echo "NEW_RELEASE=$NEW_RELEASE" >> $GITHUB_ENV
- name: Build image
run: make VERSION="${{ env.NEW_RELEASE }}" docker-build

- name: Login to quay.io/3scale
if: ${{ env.NEW_RELEASE != '' }}
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Push new operator image
run: make VERSION="${{ env.NEW_RELEASE }}" docker-push

- name: Create a new draft-release in github
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: "${{ env.NEW_RELEASE }}"
draft: true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# quay.io/3scale/marin3r-bundle:$VERSION and quay.io/3scale/marin3r-catalog:$VERSION.
IMAGE_TAG_BASE ?= quay.io/3scale/marin3r
IMAGE_TAG_BASE ?= quay.io/epic-gateway/marin3r

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
Expand Down Expand Up @@ -454,4 +454,4 @@ gen-pkg-image: ## builds the gen-pkg-image binary
cd generators/pkg-image && go build -o $${TARGET_PATH}/gen-pkg-image main.go

clean: ## Clean project directory
rm -rf tmp bin kubeconfig
rm -rf tmp bin kubeconfig

0 comments on commit 46e8001

Please sign in to comment.