Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
build on 1.x; refactor the actions/jobs'... (#158)
Browse files Browse the repository at this point in the history
* build on 1.x; refactor the actions/jobs' names a bit

Signed-off-by: RHDH Build (rhdh-bot) <[email protected]>

publish from 1.x branch to :latest tags too

Signed-off-by: RHDH Build (rhdh-bot) <[email protected]>

* Update .github/workflows/next-container-build.yaml

Co-authored-by: Armel Soro <[email protected]>

* Update .github/workflows/pr.yaml

Co-authored-by: Armel Soro <[email protected]>

* Update .github/workflows/next-container-build.yaml

Co-authored-by: Armel Soro <[email protected]>

* Update .github/workflows/pr-container-build.yaml

Co-authored-by: Armel Soro <[email protected]>

* Update .github/workflows/pr-container-build.yaml

Co-authored-by: Armel Soro <[email protected]>

* Update .github/workflows/pr.yaml

Co-authored-by: Armel Soro <[email protected]>

---------

Signed-off-by: RHDH Build (rhdh-bot) <[email protected]>
Co-authored-by: RHDH Build (rhdh-bot) <[email protected]>
Co-authored-by: Armel Soro <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2024
1 parent b073f19 commit bc9d3aa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/next-container-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build operator, bundle, and catalog images
# for main branch, use next tags; for 1.x branches, use :latest tags
name: Build and push operator, bundle, and catalog images

on:
push:
branches: [ main ]
branches:
- main
- rhdh-1.[0.9]+
- 1.[0-9]+.x

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -63,8 +67,13 @@ jobs:
# install skopeo, podman
sudo apt-get -y update; sudo apt-get -y install skopeo podman
export CONTAINER_ENGINE=podman
export VERSION=${{ env.BASE_VERSION }}-next-${{ env.SHORT_SHA }}
export CONTAINER_ENGINE=podman
latestNext="next"
# for main branch, use next tags; for 1.x branches, use :latest tags
if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then
latestNext="latest"
fi
export VERSION=${{ env.BASE_VERSION }}-${latestNext}-${{ env.SHORT_SHA }}
set -ex
Expand All @@ -76,5 +85,5 @@ jobs:
podman push quay.io/janus-idp/${image}:${VERSION} -q
skopeo --insecure-policy copy --all docker://quay.io/janus-idp/${image}:${VERSION} docker://quay.io/janus-idp/${image}:${VERSION}
skopeo --insecure-policy copy --all docker://quay.io/janus-idp/${image}:${VERSION} docker://quay.io/janus-idp/${image}:${VERSION%-*}
skopeo --insecure-policy copy --all docker://quay.io/janus-idp/${image}:${VERSION} docker://quay.io/janus-idp/${image}:next
skopeo --insecure-policy copy --all docker://quay.io/janus-idp/${image}:${VERSION} docker://quay.io/janus-idp/${image}:${latestNext}
done
9 changes: 6 additions & 3 deletions .github/workflows/pr-container-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ on:
# will prevent the job from running until it's approved manually by human intervention.
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
branches:
- main
- rhdh-1.[0.9]+
- 1.[0-9]+.x

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.event.pull_request.head.ref }}
Expand All @@ -46,7 +49,7 @@ jobs:
echo "✓"
pr-build:
name: PR Build
name: PR Publish
runs-on: ubuntu-latest
needs: authorize
permissions:
Expand Down Expand Up @@ -104,7 +107,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
name: Test Operator
# Copyright 2023 The Janus IDP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PR Test operator

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- main
- rhdh-1.[0-9]+
- 1.[0-9]+.x

jobs:
build:
pr-validate:
name: PR Validate
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit bc9d3aa

Please sign in to comment.