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

Update the 0.1.0 image in addition to the release for each merged commit in main #371

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions .github/workflows/dev_release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Create Dev Release
# Delete the previous development release and recreate it
# with code based off of the main branch.
# with code based off of the main branch. Also updates the
# DEV_RELEASE tag for the image to match.
#
# This is done so that the openshift-tools-installer has a valid
# semantic version release to install.
Expand All @@ -10,14 +11,12 @@ on:
push:
branches:
- main

env:
DEV_RELEASE: 0.1.0
jobs:
release:
name: Create Dev Release
runs-on: ubuntu-latest
env:
DEV_RELEASE: 0.1.0

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -69,7 +68,7 @@ jobs:

- name: Create the release
id: create_release
if: ${{ steps.delete-previous.outcome == 'success' && steps.sleep-after-delete-previous == 'success' }}
if: ${{ steps.delete-previous.outcome == 'success' && steps.sleep-after-delete-previous.outcome == 'success' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.DEV_RELEASE }}
Expand All @@ -79,3 +78,45 @@ 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: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Set up Python scripts
run: |
# set up python requirements and scripts on PR branch
python3 -m venv ve1
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd ..
cd scripts && ../ve1/bin/python3 setup.py install && cd ..

- name: Create image
id: build-image
run: ve1/bin/build-and-test --image-name="quay.io/redhat-certification/chart-verifier" --sha-value=$DEV_RELEASE --build-only="True"}

- name: Login to Quay as Bot
id: login-as-bot
if: ${{ steps.build-image.outcome == 'success'}}
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}
registry: quay.io/redhat-certification

- name: Push Image
if: ${{ steps.login-as-bot.outcome == 'success' }}
run: |
podman push quay.io/redhat-certification/chart-verifier:$DEV_RELEASE