set registry var #83
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: e2e | |
on: [push, workflow_dispatch] | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
run_nscloud_action: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, nscloud-ubuntu-22.04-amd64-2x8] | |
runs-on: ${{ matrix.os }} | |
name: Deploy to an ephemeral cluster in Namespace Cloud | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Namespace Cloud CLI | |
uses: ./ # Uses an action in the root directory | |
- name: Set up kubectl with an ephemeral cluster in Namespace Cloud | |
uses: namespacelabs/nscloud-cluster-action@v0 | |
- name: Apply configurations | |
run: | | |
kubectl apply -f .github/workflows/testdata/kubernetes/demo.yaml | |
- name: Wait until Redis is available | |
run: | | |
kubectl rollout status -n demo-app --watch --timeout=90s statefulset/demo-redis-server | |
push_image: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, nscloud-ubuntu-22.04-amd64-2x8] | |
runs-on: ${{ matrix.os }} | |
name: Push an image to the Namespace Cloud registry | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Namespace Cloud CLI | |
id: nscloud | |
uses: ./ # Uses an action in the root directory | |
- name: Push to private registry | |
run: | | |
echo "Pushing to ${{ steps.nscloud.outputs.registry-address }}..." | |
docker pull alpine:3.17.2 | |
docker tag alpine:3.17.2 ${{ steps.nscloud.outputs.registry-address }}/nscloud-alpine | |
docker push ${{ steps.nscloud.outputs.registry-address }}/nscloud-alpine | |
use_nsc_manually: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, nscloud-ubuntu-22.04-amd64-2x8] | |
runs-on: ${{ matrix.os }} | |
name: Create a Namespace Cloud cluster manually | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Namespace Cloud CLI | |
uses: ./ # Uses an action in the root directory | |
- name: Create a cluster | |
run: | | |
nsc cluster create --ephemeral --wait_kube_system --output_to=/tmp/cluster_id.txt | |
- name: Get pods | |
run: | | |
cat /tmp/cluster_id.txt | xargs -I % nsc kubectl % get pods -A | |
- name: Release cluster | |
if: always() | |
run: | | |
cat /tmp/cluster_id.txt | xargs -I % nsc cluster internal release % |