diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml new file mode 100644 index 0000000..f14f552 --- /dev/null +++ b/.github/workflows/build-and-push.yml @@ -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 }} diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..e1ce7f9 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/run-tests.yml similarity index 97% rename from .github/workflows/tests.yml rename to .github/workflows/run-tests.yml index 52c5ff5..96005c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,4 +1,4 @@ -name: RapiDAST +name: Run tests on: push: