File tree Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,18 @@ permissions:
1212 contents : read
1313
1414jobs :
15+ setup :
16+ if : github.event_name == 'pull_request'
17+ outputs :
18+ is_fork : ${{ steps.fork.outputs.is_fork }}
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : Identify if the PR comes from a fork
23+ id : fork
24+ run : echo "is_fork=$(gh pr view --json isCrossRepository --jq .isCrossRepository)" >> $GITHUB_OUTPUT
1525 docker-build :
26+ needs : setup
1627 permissions :
1728 contents : read
1829 packages : write
2132 name : runner-manager
2233 namespace : ${{ github.repository_owner }}
2334 tag : ${{ github.ref_name == 'main' && 'latest' || github.sha }}
35+ push : ${{ needs.setup.outputs.is_fork == 'true' && false || true }}
Original file line number Diff line number Diff line change @@ -8,24 +8,31 @@ permissions:
88 packages : write
99
1010jobs :
11- docker-build :
12- permissions :
13- contents : write
14- packages : write
15- uses : scality/workflows/.github/workflows/docker-build.yaml@v2
16- with :
17- name : runner-manager
18- namespace : ${{ github.repository_owner }}
19-
2011 test-deployment :
21- needs : docker-build
2212 runs-on : ubuntu-latest
2313 steps :
2414 - uses : actions/checkout@v4
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v3
17+ - name : Build runner-manager image
18+ uses : docker/build-push-action@v5
19+ with :
20+ context : .
21+ push : false
22+ load : true
23+ tags : ghcr.io/${{ github.repository }}:${{ github.sha }}
24+ cache-from : type=gha,scope=runner-manager
25+ cache-to : type=gha,mode=max,scope=runner-manager
2526 - uses : helm/kind-action@v1
27+ with :
28+ cluster_name : kind
29+ - name : Wait for kind node to be ready
30+ run : kubectl wait --for=condition=Ready node/kind-control-plane --timeout=120s
31+ - name : Load image to kind cluster
32+ run : kind load docker-image ghcr.io/${{ github.repository }}:${{ github.sha }}
2633 - name : Edit the runner-manager image
2734 working-directory : manifests
28- run : kustomize edit set image ghcr.io/${{ github.repository_owner }}/runner-manager :${{ github.sha }}
35+ run : kustomize edit set image ghcr.io/${{ github.repository }}:${{ github.sha }}
2936 - name : Deploy runner-manager
3037 run : kubectl apply -k manifests
3138 - name : Check if deployment is ready
You can’t perform that action at this time.
0 commit comments