-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
748 additions
and
581 deletions.
There are no files selected for viewing
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,41 @@ | ||
name: Build and push container image | ||
|
||
env: | ||
IMAGE_NAME: "rapidast" | ||
IMAGE_TAGS: "${{ github.sha }}" | ||
IMAGE_REGISTRY: quay.io/redhatproductsecurity | ||
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }} | ||
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }} | ||
|
||
on: | ||
push: | ||
branches: ["development", "main"] | ||
|
||
jobs: | ||
|
||
build-and-push: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
# https://github.com/redhat-actions/buildah-build#readme | ||
- name: Build container image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ env.IMAGE_TAGS }} | ||
dockerfiles: | | ||
./containerize/Containerfile | ||
# https://github.com/redhat-actions/push-to-registry#readme | ||
- name: Push to registry | ||
id: push-image | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ env.IMAGE_REGISTRY_USER }} | ||
password: ${{ env.IMAGE_REGISTRY_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,26 @@ | ||
name: Build container image | ||
|
||
env: | ||
IMAGE_NAME: "rapidast" | ||
IMAGE_TAGS: "${{ github.sha }}" | ||
|
||
on: | ||
pull_request: | ||
branches: ["development", "main"] | ||
|
||
jobs: | ||
|
||
build-image: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# https://github.com/redhat-actions/buildah-build#readme | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build container image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ env.IMAGE_TAGS }} | ||
dockerfiles: | | ||
./containerize/Containerfile |
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,32 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: ["development", "main"] | ||
pull_request: | ||
branches: ["development", "main"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
- name: Install dependencies | ||
run: | | ||
python3 -m ensurepip --upgrade | ||
pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
- name: Lint with pre-commit hook | ||
run: | | ||
pre-commit run --all-files --show-diff-on-failure |
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,33 @@ | ||
name: Tag image on quay.io | ||
|
||
env: | ||
IMAGE_NAME: "rapidast" | ||
IMAGE_REGISTRY: quay.io/redhatproductsecurity | ||
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }} | ||
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }} | ||
|
||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
jobs: | ||
|
||
tag-image: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# https://github.com/redhat-actions/podman-login | ||
- name: Log in to quay.io | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ env.IMAGE_REGISTRY_USER }} | ||
password: ${{ env.IMAGE_REGISTRY_PASSWORD }} | ||
|
||
- name: Tag image | ||
run: | | ||
# tag existing image on quay.io that has :<commit> tag with :<new> gh tag | ||
SRC=${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
DST=${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | ||
skopeo copy docker://${SRC} docker://${DST} |
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
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
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
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
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
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
Oops, something went wrong.