install virtctl #63
Workflow file for this run
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
name: Build & deploy released Version | |
on: | |
push: | |
tags: | |
- 'webshell-*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to Quay.io Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAYIO_USERNAME }} | |
password: ${{ secrets.QUAYIO_TOKEN }} | |
- | |
name: Login to the ghcr.io Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Get the version # strip away "ref/tags/webshell-" | |
id: get_version | |
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/webshell-//g')" >> $GITHUB_OUTPUT | |
- | |
name: Build Release Version | |
uses: docker/build-push-action@v6 | |
with: | |
context: build | |
push: true | |
tags: | | |
quay.io/acend/theia:${{ steps.get_version.outputs.VERSION }} | |
ghcr.io/acend/theia:${{ steps.get_version.outputs.VERSION }} | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- | |
name: 'Install Helm' | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.6.2 | |
- | |
name: Install Kubectl | |
uses: azure/setup-kubectl@v4 | |
with: | |
version: v1.21.2 | |
- | |
name: Create KUBECONFIG | |
env: | |
KUBE_CONFIG: '${{ secrets.KUBECONFIG_K8S_ACEND }}' | |
run: | | |
mkdir -p $HOME/.kube | |
echo "$KUBE_CONFIG" > $HOME/.kube/config | |
- | |
name: Deploy Helm Release | |
env: | |
HELM_RELEASE: 'demo-webshell' | |
NAMESPACE: 'acend-webshell' | |
PASSWORD: '${{ secrets.WEBSHELL_TEST_PASSWORD }}' | |
run: | | |
helm upgrade $HELM_RELEASE webshell --install --wait --kubeconfig $HOME/.kube/config --namespace=$NAMESPACE --repo=https://acend.github.io/webshell-env/ --set password=$PASSWORD --values=deploy/charts/webshell/values-demo.yaml --atomic | |
- | |
name: Redeploy Webshell | |
env: | |
NAMESPACE: 'acend-webshell' | |
HELM_RELEASE: 'demo-webshell' | |
run: | | |
kubectl rollout restart deployment/$HELM_RELEASE --kubeconfig $HOME/.kube/config --namespace $NAMESPACE |