-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (67 loc) · 2.43 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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 %