Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
  • Loading branch information
adrianriobo committed Aug 1, 2024
1 parent 4b408c7 commit cffdc1a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 44 deletions.
44 changes: 8 additions & 36 deletions .github/workflows/snc-runner-oci-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,27 @@ jobs:
- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
env:
SNC_RUNNER: ghcr.io/crc-org/ci-snc-runner
# SNC_RUNNER: ghcr.io/crc-org/ci-snc-runner
SNC_RUNNER: ghcr.io/adrianriobo/ci-snc-runner
SNC_RUNNER_V: pr-${{ github.event.number }}
run: |
make snc-runner-oci-build
SNC_RUNNER_SAVE=snc-runner make snc-runner-oci-save
echo "SNC_RUNNER=${SNC_RUNNER}" >> "$GITHUB_ENV"
echo "SNC_RUNNER_V=${SNC_RUNNER_V}" >> "$GITHUB_ENV"
echo "image=${SNC_RUNNER}" >> "$GITHUB_ENV"
echo "tag=${SNC_RUNNER_V}" >> "$GITHUB_ENV"
- name: Build image for Release
if: ${{ github.event_name == 'push' }}
run: |
make snc-runner-oci-build
SNC_RUNNER_SAVE=snc-runner make snc-runner-oci-save
# Get values from release-info
SNC_RUNNER ?= $(sed -n 1p snc-runner/release-info)
SNC_RUNNER_V ?= v$(sed -n 2p snc-runner/release-info)
echo "SNC_RUNNER=${SNC_RUNNER}" >> "$GITHUB_ENV"
echo "SNC_RUNNER_V=${SNC_RUNNER_V}" >> "$GITHUB_ENV"
echo "image=$(sed -n 1p snc-runner/release-info)" >> "$GITHUB_ENV"
echo "tag=v$(sed -n 2p snc-runner/release-info)" >> "$GITHUB_ENV"
- name: Create image metadata
run: |
echo ${{ env.SNC_RUNNER }}:${{ env.SNC_RUNNER_V }} > snc-runner-info
echo ${{ env.image }}:${{ env.tag }} > snc-runner-image
echo ${{ github.event_name }} > snc-runner-build-event
- name: Upload snc-runner
Expand All @@ -51,34 +50,7 @@ jobs:
name: snc-runner
path: snc-runner*

- name: Build image for Release
run: |
rm -rf *
- name: Download crc-builder-oci assets
id: download-gh-context-artifact
uses: actions/download-artifact@v4
with:
name: snc-runner

- name: Build image for Release
run: |
ls -al
BUILD_EVENT=$(cat snc-runner-build-event)
MANIFEST=$(cat snc-runner-info)
echo ${BUILD_EVENT}
echo ${MANIFEST}
echo "BUILD_EVENT=${BUILD_EVENT}" >> "$GITHUB_ENV"
- name: Login ghcr
if: ${{ env.BUILD_EVENT == 'pull_request' }}
run: |
echo "It is a PR"
- name: Login quay
if: ${{ env.BUILD_EVENT == 'push' }}
run: |
echo "It is a Release"




38 changes: 30 additions & 8 deletions .github/workflows/snc-runner-oci-pusher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,36 @@ jobs:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Build image for Release
- name: Get snc-runner build informaiton
run: |
BUILD_EVENT=$(cat snc-runner-build-event)
MANIFEST=$(cat snc-runner-build-event)
echo "source_event=$(cat snc-runner-build-event)" >> "$GITHUB_ENV"
echo "image=$(cat snc-runner-image)" >> "$GITHUB_ENV"
- name: Log in to ghcr.io for PR
if: ${{ env.source_event == 'pull_request' }}
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to ghcr.io
if: ${{ env.source_event == 'push' }}
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# er 4096 Aug 1 11:13 snc-runner
# -rw-r--r-- 1 runner docker 13 Aug 1 11:13 snc-runner-build-event
# -rw-r--r-- 1 runner docker 36 Aug 1 11:13 snc-runner-info
# -rw-r--r-- 1 runner docker 305697792 Aug 1 11:13 snc-runner.tar
- name: Loginquay.io
if: ${{ env.source_event == 'push' }}
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}

- name: Push snc-runner
run: |
podman load -i snc-runner.tar
podman push ${{ env.image }}

0 comments on commit cffdc1a

Please sign in to comment.