Skip to content

Commit

Permalink
Build dev release container image in main
Browse files Browse the repository at this point in the history
close #391

Signed-off-by: mgoerens <[email protected]>
  • Loading branch information
mgoerens authored and komish committed Aug 24, 2023
1 parent a9c5989 commit db98e45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
33 changes: 2 additions & 31 deletions .github/workflows/dev_release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Create Dev Release
# Delete the previous development release and recreate it
# with code based off of the main branch. Also updates the
# DEV_RELEASE tag for the image to match.
# with code based off of the main branch. The DEV_RELEASE
# tag is updated as part of the "main.yaml" workfmow.
#
# This is done so that the openshift-tools-installer has a valid
# semantic version release to install.
Expand Down Expand Up @@ -78,32 +78,3 @@ jobs:
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image:
name: Create Dev Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Build container images
id: build_container_images
run: |
# Build podman images locally
make build-image IMAGE_TAG=$DEV_RELEASE
- name: Push to quay.io
id: push_to_quay
uses: redhat-actions/push-to-registry@v2
with:
image: chart-verifier
tags: |
${{ env.DEV_RELEASE }}
registry: quay.io/redhat-certification
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Create container image on main

# This workflow builds a container image for each commit on the main branch.
# The image is tagged with the (short) commit ID and "main", and pushed to Quay.
# The image is tagged with the (short) commit ID, "main" and "0.1.0" (i.e. the
# development release), and pushed to Quay.

on:
push:
branches:
- main
env:
DEV_RELEASE: 0.1.0
CONTAINER_REGISTRY: quay.io/redhat-certification
jobs:
image:
name: Build and push container images
Expand All @@ -29,6 +33,7 @@ jobs:
# Build podman images locally
make build-image IMAGE_TAG=${{ steps.get_commit_id.outputs.commit_id }} QUAY_EXPIRE_AFTER=1w
make build-image IMAGE_TAG=main
podman tag ${{ env.CONTAINER_REGISTRY }}/chart-verifier:main ${{ env.CONTAINER_REGISTRY }}/chart-verifier:${{ env.DEV_RELEASE }}
- name: Push to quay.io
id: push_to_quay
Expand All @@ -38,6 +43,7 @@ jobs:
tags: |
${{ steps.get_commit_id.outputs.commit_id }}
main
${{ env.DEV_RELEASE }}
registry: quay.io/redhat-certification
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}

0 comments on commit db98e45

Please sign in to comment.