Skip to content

Commit

Permalink
Add workflows for building and pushing container image (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfowl authored Oct 1, 2024
1 parent 1fe29e2 commit f625c92
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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

# 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
# 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 }}
26 changes: 26 additions & 0 deletions .github/workflows/build-image.yml
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: RapiDAST
name: Run tests

on:
push:
Expand Down

0 comments on commit f625c92

Please sign in to comment.