-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-action: add workflow to build test images
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 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,68 @@ | ||
name: Build test images | ||
on: | ||
# push: | ||
# branches: | ||
# - "main" | ||
pull_request: {} | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME_E2E: crc-e2e | ||
IMAGE_NAME_INTEGRATION: crc-integration | ||
|
||
jobs: | ||
build-e2e: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build e2e image | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
CRC_E2E_IMG_VERSION=pr-${PR_NUMBER} IMG_E2E=${{ env.REGISTRY}}/${{ github.repository_owner }}/${{env.IMAGE_NAME_E2E}}:${CRC_E2E_IMG_VERSION} make containerized_e2e | ||
- name: Push e2e image | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
podman push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{env.IMAGE_NAME_E2E}}:pr-${PR_NUMBER} | ||
build-integration: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build integration image | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
CRC_INTEGRATION_IMG_VERSION=pr-${PR_NUMBER} IMG_INTEGRATION=${{ env.REGISTRY}}/${{ github.repository_owner }}/${{env.IMAGE_NAME_INTEGRATION}}:${CRC_INTEGRATION_IMG_VERSION} make containerized_integration | ||
- name: Push integration image | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
podman push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{env.IMAGE_NAME_INTEGRATION}}:pr-${PR_NUMBER} |