forked from k8snetworkplumbingwg/sriov-network-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Zeevi <[email protected]>
- Loading branch information
Showing
1 changed file
with
21 additions
and
14 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ name: Fork Docker CI | |
on: | ||
push: | ||
branches: | ||
- feature/ci # TODO: remove after developing | ||
- network-operator-* | ||
tags: | ||
- network-operator-* | ||
|
@@ -46,7 +47,7 @@ jobs: | |
strategy: | ||
matrix: | ||
include: | ||
- component: controller | ||
- component: operator | ||
image_name: ${{ github.event.repository.name }} | ||
dockerfile: Dockerfile | ||
- component: config-daemon | ||
|
@@ -64,13 +65,13 @@ jobs: | |
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ secrets.NVCR_USERNAME }} | ||
password: ${{ secrets.NVCR_TOKEN }} | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
platforms: ${{ env.BUILD_PLATFORMS }} | ||
context: . | ||
file: ${{ matrix.dockerfile }} | ||
tags: ${{ env.DOCKER_REGISTRY }}/${{ matrix.image_name }}:${{ env.DOCKER_TAG }} | ||
push: true | ||
# - uses: docker/build-push-action@v4 # TODO: uncomment after testing | ||
# with: | ||
# platforms: ${{ env.BUILD_PLATFORMS }} | ||
# context: . | ||
# file: ${{ matrix.dockerfile }} | ||
# tags: ${{ env.DOCKER_REGISTRY }}/${{ matrix.image_name }}:${{ env.DOCKER_TAG }} | ||
# push: true | ||
|
||
update_network_operator_values: | ||
needs: | ||
|
@@ -79,25 +80,31 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_TAG: ${{ needs.determine_docker_registry_and_tag.outputs.docker_tag }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN_NETWORK_OPERATOR }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_TOKEN_NETWORK_OPERATOR }} | ||
token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} | ||
repository: ${{ github.repository_owner }}/network-operator | ||
sparse-checkout-cone-mode: false | ||
sparse-checkout: deployment/network-operator/values.yaml | ||
- name: Create PR to update image tags in network-operator values | ||
run: | | ||
git config user.name nvidia-ci-cd | ||
git config user.email [email protected] | ||
git checkout -b feature/update-sriov-tags-to-$DOCKER_TAG | ||
sed -Ei "s/:network-operator-.+/:$DOCKER_TAG/g" deployment/network-operator/values.yaml | ||
echo AAAAAAAAAA # debug | ||
git branch # debug | ||
sed -Ei "s/(version: )network-operator-.+/\\1$DOCKER_TAG/g" hack/release.yaml # TODO: test escaped backslash in github env. | ||
echo BBBBBBBBBB # debug | ||
git diff --color --unified=0 # debug | ||
make release-build | ||
echo CCCCCCCCCC # debug | ||
if ! git diff --color --unified=0 --exit-code; then | ||
git commit -am "task: update SR-IOV images tags to $DOCKER_TAG in chart values" | ||
git commit -sam "task: update SR-IOV images tags to $DOCKER_TAG in chart values" | ||
echo DDDDDDDDDD # debug | ||
git push -u origin feature/update-sriov-tags-to-$DOCKER_TAG | ||
echo EEEEEEEEEE # debug | ||
gh pr create \ | ||
--repo ${{ github.repository_owner }}/network-operator \ | ||
--base master \ | ||
|