forked from Kuadrant/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Kuadrant#229 from pehala/build_changes
Add automatic builds
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
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
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,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 }}" |
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,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 |