-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github actions for releasing manifests and images
Images are pushed to ghcr.io as part of release. Signed-off-by: Parth Yadav <[email protected]>
- Loading branch information
1 parent
d95384c
commit fc619a6
Showing
19 changed files
with
144 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
name: Release BYOH controller | ||
|
||
# on: | ||
# push: | ||
# # Build and publish artifacts when new tag is created for release | ||
# tags: | ||
# - "v*.*.*" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-and-publish-byoh-controller: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry (ghcr.io) | ||
env: | ||
DOCKER_USER: ${{ github.repository_owner }} | ||
DOCKER_PWD: ${{ secrets.GITHUB_TOKEN }} | ||
run: docker login -u $DOCKER_USER -p $DOCKER_PWD ghcr.io | ||
|
||
# - name: pre-cleanup the docker | ||
# run: sudo docker system prune -a -f && sudo docker buildx prune | ||
|
||
# - name: build and push controller image | ||
# env: | ||
# REPO: ${{ github.repository_owner }} | ||
# TAG: ${{ github.ref_name }} | ||
# run: | | ||
# IMG=ghcr.io/$REPO/cluster-api-byoh-controller:$TAG make docker-build | ||
# docker push ghcr.io/$REPO/cluster-api-byoh-controller:$TAG | ||
|
||
- name: Make the image public via GitHub API | ||
env: | ||
REPO: ${{ github.repository_owner }} | ||
TAG: ${{ github.ref_name }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
curl -X GET \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/cluster-api-byoh-controller?tag=v0.5.1 \ | ||
-d '{"visibility":"public"}' | ||
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,64 @@ | ||
name: Release k8s BYOH Bundles | ||
|
||
on: | ||
push: | ||
# Build and publish artifacts when new tag is created for release | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build-and-publish-k8s-bundles: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry (ghcr.io) | ||
env: | ||
DOCKER_USER: ${{ github.repository_owner }} | ||
DOCKER_PWD: ${{ secrets.GITHUB_TOKEN }} | ||
run: docker login -u $DOCKER_USER -p $DOCKER_PWD ghcr.io | ||
|
||
- name: pre-cleanup the docker | ||
run: sudo docker system prune -a -f && sudo docker buildx prune | ||
|
||
- name: Build BYOH Ingredients Docker image | ||
run: | | ||
cd installer/bundle_builder/ingredients/deb/ | ||
docker build -t byoh-ingredients-deb . | ||
- name: Create BYOH Ingredients directory and download files | ||
run: | | ||
mkdir -p byoh-ingredients-download | ||
docker run --rm -v ${{ github.workspace }}/byoh-ingredients-download:/ingredients byoh-ingredients-deb | ||
- name: Build BYOH Bundle Docker image | ||
run: | | ||
cd installer/bundle_builder/ | ||
docker build -t byoh-build-push-bundle . | ||
- name: Build and Publish BYOH Bundle | ||
env: | ||
BUILD_ONLY: 0 | ||
REPO: ${{ github.repository_owner }} | ||
BUNDLE_NAME: byoh-bundle-ubuntu_20.04.1_x86-64_k8s | ||
TAG: v1.31.0 | ||
run: | | ||
docker run --rm -v ~/.docker/config.json:/root/.docker/config.json -v ${{ github.workspace }}/byoh-ingredients-download:/ingredients --env BUILD_ONLY=${{ env.BUILD_ONLY }} byoh-build-push-bundle ghcr.io/$REPO/$BUNDLE_NAME:$TAG | ||
- name: Cleanup Docker | ||
run: sudo docker logout && sudo docker system prune -a -f && sudo docker buildx prune | ||
|
||
- name: Make the image public via GitHub API | ||
env: | ||
REPO: ${{ github.repository_owner }} | ||
BUNDLE_NAME: byoh-bundle-ubuntu_20.04.1_x86-64_k8s | ||
TAG: v1.31.0 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
IMAGE_URL="ghcr.io/$REPO/$BUNDLE_NAME" | ||
curl -X PATCH \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/$BUNDLE_NAME/versions/latest \ | ||
-d '{"visibility":"public"}' |
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
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
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
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
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
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 |
---|---|---|
|
@@ -59,5 +59,5 @@ metadata: | |
spec: | ||
template: | ||
spec: | ||
bundleRepo: coredgeio | ||
bundleRepo: ghcr.io/coredgeio | ||
bundleType: k8s |
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
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
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
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
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 |
---|---|---|
|
@@ -59,5 +59,5 @@ metadata: | |
spec: | ||
template: | ||
spec: | ||
bundleRepo: coredgeio | ||
bundleRepo: ghcr.io/coredgeio | ||
bundleType: k8s |
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
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
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
Oops, something went wrong.