Skip to content

Commit

Permalink
Merge pull request Kuadrant#229 from pehala/build_changes
Browse files Browse the repository at this point in the history
Add automatic builds
  • Loading branch information
pehala authored Nov 1, 2023
2 parents 38c1416 + db228cb commit c82a058
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
env:
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
IMG_NAME: testsuite

jobs:
build:
Expand All @@ -33,7 +34,7 @@ jobs:
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: testsuite
image: ${{ env.IMG_NAME }}
tags: ${{ env.IMG_TAGS }}
layers: true
platforms: linux/amd64
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/build_unstable_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and push image

on:
push:
branches:
- main

env:
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
IMG_NAME: testsuite
IMG_TAGS: unstable

jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMG_NAME }}
tags: ${{ env.IMG_TAGS }}
layers: true
platforms: linux/amd64
containerfiles: |
./Dockerfile
- name: Push Image
if: ${{ !env.ACT }}
id: 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.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}
username: ${{ secrets.IMG_REGISTRY_USERNAME }}
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
- name: Print Image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
29 changes: 29 additions & 0 deletions .github/workflows/promote_to_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Promotes unstable image to latest

on:
workflow_dispatch:

env:
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
IMG_NAME: testsuite

jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
steps:
- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}
username: ${{ secrets.IMG_REGISTRY_USERNAME }}
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
- name: Create repository name
run: |
echo "REPOSITORY=${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.IMG_NAME }}" >> $GITHUB_ENV
- name: Promotes to latest
run:
podman pull ${{ env.REPOSITORY }}:unstable
podman tag ${{ env.REPOSITORY }}:unstable ${{ env.REPOSITORY }}:latest
podman push ${{ env.REPOSITORY }}:latest

0 comments on commit c82a058

Please sign in to comment.