generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github action based build jobs (#637)
- Loading branch information
Showing
4 changed files
with
96 additions
and
2 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,18 @@ | ||
name: Pull Build Image | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited, synchronize, reopened, ready_for_review] | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT token | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
build: | ||
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main | ||
with: | ||
name: eventing-manager | ||
dockerfile: Dockerfile | ||
context: . | ||
export-tags: true |
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,39 @@ | ||
name: Push Build Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "release-*" | ||
paths-ignore: | ||
- "docs/**" | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT token | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
compute-tags: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tags: ${{ steps.get_tag.outputs.TAGS }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Get the latest tag | ||
id: get_tag | ||
run: | | ||
{ | ||
echo 'TAGS<<EOF' | ||
echo "${{ github.sha }}" | ||
echo "${{ github.ref_name}}" | ||
echo EOF | ||
} >> "$GITHUB_OUTPUT" | ||
build: | ||
needs: compute-tags | ||
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main | ||
with: | ||
name: eventing-manager | ||
dockerfile: Dockerfile | ||
context: . | ||
tags: ${{ needs.compute-tags.outputs.tags }} |
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,37 @@ | ||
name: Tag Build Image | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' # This will trigger the workflow when a tag (x.y.z) is pushed. | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT token | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
compute-tags: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tags: ${{ steps.get_tag.outputs.TAGS }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Get the latest tag | ||
id: get_tag | ||
run: | | ||
{ | ||
echo 'TAGS<<EOF' | ||
echo "${{ github.sha }}" | ||
echo "${{ github.ref_name}}" | ||
echo EOF | ||
} >> "$GITHUB_OUTPUT" | ||
build: | ||
name: build-${{ github.ref_name }} # The release pipeline will check the status of this job by this name format (e.g. build-1.0.1). | ||
needs: compute-tags | ||
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main | ||
with: | ||
name: eventing-manager | ||
dockerfile: Dockerfile | ||
context: . | ||
tags: ${{ needs.compute-tags.outputs.tags }} |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ FROM europe-docker.pkg.dev/kyma-project/prod/external/library/golang:1.23.0-alpi | |
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
WORKDIR /workspace | ||
WORKDIR /app | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
|
@@ -32,7 +32,7 @@ FROM gcr.io/distroless/static:nonroot | |
LABEL source = [email protected]:kyma-project/eventing-manager.git | ||
|
||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
COPY --from=builder /app/manager . | ||
USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/manager"] |