Skip to content

Readme revamp

Readme revamp #103

name: Test - Deployment - Helm Chart
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- closed
permissions:
contents: read
pull-requests: write
id-token: write
jobs:
build-operator:
uses: ./.github/workflows/build-operator.yaml
name: Build Operator Image
secrets: inherit
uffizzi-cluster:
needs:
- build-operator
name: Deploy Helm chart to Uffizzi Virtual Cluster
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Helm Values Artifact
uses: actions/download-artifact@v3
with:
name: helm-values
# Identify comment to be updated
- name: Find comment for Ephemeral Environment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: pr-${{ github.event.pull_request.number }}-e2e-helm
direction: last
# Create/Update comment with action deployment status
- name: Create or Update Comment with Deployment Notification
id: notification
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Uffizzi Ephemeral Environment - Virtual Cluster - E2E Helm Chart
:cloud: deploying ...
:gear: Updating now by workflow run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
Cluster name will be `pr-${{ github.event.pull_request.number }}-e2e-helm`
Download the Uffizzi CLI to interact with the upcoming virtual cluster
https://docs.uffizzi.com/install
edit-mode: replace
- name: Create and connect to vcluster
uses: UffizziCloud/cluster-action@main
with:
cluster-name: pr-${{ github.event.pull_request.number }}-e2e-helm
server: https://app.uffizzi.com
- name: Apply Helm Chart
id: prev
run: |
if [[ ${RUNNER_DEBUG} == 1 ]]; then
echo "`pwd`"
echo "`ls`"
fi
export KUBECONFIG="`pwd`/kubeconfig"
helm dep update ./chart
helm upgrade --install --wait pr-${{ github.event.pull_request.number }} \
./chart -f helm-values.yaml
- name: Create or Update Comment with Deployment URL
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.notification.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Uffizzi Ephemeral Environment - Virtual Cluster - E2E Helm Chart
E2E tests in progress on the `pr-${{ github.event.pull_request.number }}-e2e-helm` cluster.
edit-mode: replace
uffizzi-cluster-delete:
if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
runs-on: ubuntu-latest
steps:
- name: Delete Virtual Cluster
uses: UffizziCloud/cluster-action@main
with:
action: delete
cluster-name: pr-${{ github.event.pull_request.number }}-e2e-helm
server: https://app.uffizzi.com
# Identify comment to be updated
- name: Find comment for Ephemeral Environment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: pr-${{ github.event.pull_request.number }}-e2e-helm
direction: last
- name: Update Comment with Deletion
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Uffizzi Cluster `pr-${{ github.event.pull_request.number }}` was deleted.
edit-mode: replace