-
Notifications
You must be signed in to change notification settings - Fork 3
151 lines (110 loc) · 4.66 KB
/
devcontainer-feature-build-publish.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: spacefx-dev-build-publish
on:
workflow_dispatch:
inputs:
VER_DOCKER_MAX:
description: 'Docker version to install'
required: false
type: string
default: "26.1.3"
push:
branches:
- main
env:
REGISTRY: ghcr.io
FEATURE: microsoft/azure-orbital-space-sdk/spacefx-dev
ARTIFACT_PATH: ./output/spacefx-dev/devcontainer-feature-spacefx-dev.tgz
jobs:
test-prod:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-docker@main
with:
VER_DOCKER_MAX: ${{ inputs.VER_DOCKER_MAX }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/initialize@main
with:
env_file: ./env/spacefx.env
token: ${{ secrets.GITHUB_TOKEN }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/registry-login@main
with:
registry-name: ${{ env.REGISTRY }}
github-user-name: ${{ secrets.GIT_HUB_USER_NAME }}
github-user-token: ${{ secrets.GIT_HUB_USER_TOKEN }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-oras@main
with:
oras_version: 0.16.0
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-devcontainer-cli@main
- name: Testing Prod Cluster
shell: bash
run: |
echo "Running prod_cluster.sh test..."
bash ./tests/prod_cluster.sh
build-publish-feature:
runs-on: ubuntu-latest
needs: test-prod
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/initialize@main
with:
env_file: ./env/spacefx.env
token: ${{ secrets.GITHUB_TOKEN }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-oras@main
with:
oras_version: 0.16.0
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-devcontainer-cli@main
- name: Build and publish devcontainer feature
shell: bash
run: |
echo "Sourcing environment variables..."
source ./env/spacefx.env
# Validate the output directory exists and clean it out if there is content already present
echo "Creating output directory..."
mkdir -p "./output/spacefx-dev"
# Copy the scripts ino the entry point for the devcontainer feature
echo "Copying all files to /var/spacedev..."
./.vscode/copy_to_spacedev.sh --output-dir ./.devcontainer/features/spacefx-dev/azure-orbital-space-sdk-setup
# Build the devcontainer feature
echo "Building the devcontainer feature..."
devcontainer features package --force-clean-output-folder ./.devcontainer/features --output-folder ./output/spacefx-dev
# Push the devcontainer feature tarball to the registry
echo "Pushing the devcontainer feature tarball to the registry..."
oras push ${{ env.REGISTRY }}/${{ env.FEATURE }}:${SPACEFX_VERSION} \
--config /dev/null:application/vnd.devcontainers \
--annotation org.opencontainers.image.source=https://github.com/microsoft/azure-orbital-space-sdk-setup \
${{ env.ARTIFACT_PATH }}:application/vnd.devcontainers.layer.v1+tar
test-dev:
runs-on: ubuntu-latest
needs: build-publish-feature
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-docker@main
with:
VER_DOCKER_MAX: ${{ inputs.VER_DOCKER_MAX }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/initialize@main
with:
env_file: ./env/spacefx.env
token: ${{ secrets.GITHUB_TOKEN }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/registry-login@main
with:
registry-name: ${{ env.REGISTRY }}
github-user-name: ${{ secrets.GIT_HUB_USER_NAME }}
github-user-token: ${{ secrets.GIT_HUB_USER_TOKEN }}
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-oras@main
with:
oras_version: 0.16.0
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-devcontainer-cli@main
- name: Testing dev cluster
shell: bash
run: |
echo "Running dev_cluster.sh test..."
bash ./tests/dev_cluster.sh