-
Notifications
You must be signed in to change notification settings - Fork 26
37 lines (34 loc) · 1.43 KB
/
pull-build-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This workflow is responsible for all kinds of integration tests run on pull request.
# Those tests depend on a container image so in the first job we wait for the image build to succeed.
name: PR Build and Push Manager Image
on:
# pull_request_target runs workflows from the base of PR
# It allows the workflow to get the repository secrets
pull_request_target:
types: [ synchronize, opened, reopened, ready_for_review ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "tests/performance/**"
- "OWNERS"
- "CODEOWNERS"
- ".github/**" #Ignoring since build job isn't triggered on the workflow directory changes
- "external-images.yaml"
branches:
- 'main'
jobs:
build-image:
name: Build and push manager image
environment: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' && 'restricted' || 'internal' }}
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/build-manager-image
with:
operator-image-name: "europe-central2-docker.pkg.dev/sap-se-cx-kyma-goat/api-gateway/api-gateway-manager:PR-${{github.event.number}}"
push-image: 'true'
push-sa-key: ${{ secrets.GCP_SA_KEY }}