-
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.
- Loading branch information
Showing
2 changed files
with
83 additions
and
12 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
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,83 @@ | ||
name: tap-operator CI | ||
env: | ||
IMAGE_NAME_CP: ${{ github.repository }}-copy-packages | ||
IMAGE_NAME_OPERATOR: ${{ github.repository }} | ||
REGISTRY: ghcr.io | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build-tap-operator: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up JDK 21 for x64 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "21" | ||
distribution: "temurin" | ||
- name: Run the Maven verify phase | ||
run: mvn --batch-mode --update-snapshots verify | ||
- name: Log in to the container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5.3.0 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_OPERATOR }} | ||
- name: Run the Maven spring-boot:build-image | ||
run: mvn spring-boot:build-image -Dspring-boot.build-image.imageName=${{ steps.meta.outputs.tags }} | ||
- name: Push Image | ||
run: docker push ${{ steps.meta.outputs.tags }} | ||
- name: Archive Release | ||
uses: thedoctor0/zip-release@0.7.5 | ||
with: | ||
type: 'zip' | ||
filename: 'tap-operator.zip' | ||
path: config | ||
command: cp target/classes/META-INF/fabric8/tapresources.org.moussaud.tanzu-v1.yml config/ | ||
- name: Upload Release | ||
uses: ncipollo/release-action@v1.12.0 | ||
with: | ||
artifacts: "tap-operator.zip" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-copy-packages-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: initialize carvel tools | ||
uses: carvel-dev/setup-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
imgpkg version | ||
kbld version | ||
- name: Log in to the container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5.3.0 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_CP }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5.1.0 | ||
with: | ||
context: copy-packages | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |