forked from unikraft-cloud/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-code-server-stable.yaml
More file actions
90 lines (74 loc) · 2.49 KB
/
Copy pathexample-code-server-stable.yaml
File metadata and controls
90 lines (74 loc) · 2.49 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: examples/code-server (stable)
on:
workflow_dispatch:
push:
branches: [ mariaciobanoiu8/code-server ]
paths:
- '.github/workflows/example-code-server-stable.yaml'
- 'code-server/**'
- '!code-server/README.md'
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ main ]
paths:
- '.github/workflows/example-code-server-stable.yaml'
- 'code-server/**'
- '!code-server/README.md'
schedule:
- cron: '0 15 * * 1-5'
# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
UKC_METRO: "https://api.${{ vars.UKC_METRO_STABLE }}.unikraft.cloud/v1"
UKC_TOKEN: ${{ secrets.UKC_TOKEN }}
KRAFTKIT_NO_CHECK_UPDATES: true
KRAFTKIT_LOG_LEVEL: debug
jobs:
integration:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
id: test
uses: unikraft/kraftkit@staging
with:
run: |
set -xe;
cd code-server;
kraft cloud volume create \
--name code-workspace \
--size 1Gi
kraft cloud deploy \
--no-start \
--scale-to-zero on \
--scale-to-zero-stateful \
--scale-to-zero-cooldown 4s \
--name code-server-${GITHUB_RUN_ID} \
--runtime index.unikraft.io/official-staging/base-compat:latest \
--subdomain code-server-${GITHUB_RUN_ID} \
-p 443:8443 \
-M 2Gi \
-v code-workspace:/workspace \
-e PGUID=0 \
-e PGID=0 \
-e PASSWORD=unikraft \
-e SUDO_PASSWORD=unikraft \
-e DEFAULT_WORKSPACE="/workspace" \
.;
# wait for the instance to start
kraft cloud vm start -w 5s code-server-${GITHUB_RUN_ID};
sleep 5;
curl -Lv --fail-with-body --max-time 10 https://code-server-${GITHUB_RUN_ID}.${{ vars.UKC_METRO_STABLE }}.unikraft.app
- name: Cleanup
uses: unikraft/kraftkit@staging
if: always()
with:
run: |
set -xe;
kraft cloud vm stop code-server-${GITHUB_RUN_ID} || true;
kraft cloud vm logs code-server-${GITHUB_RUN_ID} || true;
kraft cloud vm rm code-server-${GITHUB_RUN_ID} || true;
kraft cloud img rm index.unikraft.io/test/code-server-${GITHUB_RUN_ID} || true;