Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Migrate workflow from Prow to GitHub Actions #86

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Image

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- "main"
- "release-[0-9]+.[0-9]+"
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
push:
branches:
- "main"
tags:
- "[0-9]+.[0-9]+.[0-9]+(-.*)?"
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
jobs:
envs:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.create-tags.outputs.tags }}

steps:
- name: create tags
id: create-tags
run: |
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
echo 'TAGS=${{ github.ref_name }}' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
echo 'PR-${{ github.event.pull_request.number }}'
echo '${{ github.event.pull_request.head.sha }}'
echo 'TAGS'
} >> "$GITHUB_OUTPUT"
fi

build-image:
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: kyma-metrics-collector
dockerfile: Dockerfile
context: .
tags: ${{ needs.envs.outputs.tags }}
Loading