-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from tisutisu/script-image
Infra deployment task script image
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
.github/workflows/build-infra-deployment-task-script-image-on-push.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build Script Image on Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- update-infra-deployments-task-scripts-image/Dockerfile | ||
|
||
env: | ||
REGISTRY: quay.io/redhat-appstudio | ||
IMAGE_NAME: update-infra-deployments-task-script-image | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to Red Hat Registry | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: registry.redhat.io | ||
username: ${{ secrets.REGISTRY_REDHAT_IO_USER }} | ||
password: ${{ secrets.REGISTRY_REDHAT_IO_PASSWORD }} | ||
|
||
- name: Build Image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ github.sha }} | ||
context: . | ||
containerfiles: | | ||
./update-infra-deployments-task-scripts-image/Dockerfile | ||
- name: Push to Quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Check Author | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- update-infra-deployments-task-scripts-image/Dockerfile | ||
|
||
jobs: | ||
check-author: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check the author | ||
shell: bash | ||
run: | | ||
owners=$(yq e ".allowed_users.[]" OWNERS) | ||
function exists_in_user_list() { | ||
LIST=$1 | ||
DELIMITER=$2 | ||
VALUE=$3 | ||
LIST_WHITESPACES=`echo $LIST | tr "$DELIMITER" " "` | ||
for x in $LIST_WHITESPACES; do | ||
if [ "$x" = "$VALUE" ]; then | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
if exists_in_user_list "$owners" " " ${{ github.actor }} ; then | ||
echo "PR author is in the allowed users list" | ||
exit 0 | ||
else | ||
echo "PR author is NOT in the allowed users list" | ||
exit 1 | ||
fi | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v40 | ||
|
||
- name: Check if OWNERS file changed | ||
shell: bash | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
if [ $file = "OWNERS" ]; then | ||
echo "OWNERS file is changed" | ||
exit 1 | ||
else | ||
echo "OWNERS file is NOT changed" | ||
fi | ||
done | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM registry.redhat.io/openshift4/ose-cli:v4.11.0-202311302048.p0.g94eb522.assembly.stream | ||
|
||
RUN dnf install -y git-core && dnf clean all |