-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (69 loc) · 2.27 KB
/
main.yaml
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
name: CI
on:
push:
branches: [ master, alma ]
env:
STORAGE_ACCOUNT_NAME: ${{ secrets.STORAGE_ACCOUNT_NAME }}
STORAGE_CONTAINER_NAME: vhd
BASE_IMAGE_NAME: baked-centos-7
REGION: westus
RESOURCE_GROUP: vm-build
VM_USERNAME: ${{ secrets.VM_USERNAME }}
VM_PASSWORD: ${{ secrets.VM_PASSWORD }}
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
jobs:
vmbuild:
runs-on: ubuntu-latest
env:
BUILDER_VM_NAME: vm-packer
BUILDER_VM_SIZE: Standard_D4s_v3
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1.1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Show all files
run: ls -l
- name: Deploy Builder VM
run: |
./create-inception.sh "$RESOURCE_GROUP" \
"$REGION" \
"$BUILDER_VM_NAME" \
"$VM_USERNAME" \
"$VM_PASSWORD" \
"$BUILDER_VM_SIZE"
- name: Packer build VHD
run: |
./run-packer-build.sh "$RESOURCE_GROUP" \
"$BUILDER_VM_NAME"
- name: VHD Upload
run: |
./run-upload-vhd.sh "$RESOURCE_GROUP" \
"$BUILDER_VM_NAME" \
"$STORAGE_ACCOUNT_NAME" \
"$STORAGE_CONTAINER_NAME" \
"$BASE_IMAGE_NAME" \
"$GITHUB_RUN_ID"
testvhd:
runs-on: ubuntu-latest
needs: vmbuild
env:
TEST_VM_NAME: test-vm
TEST_VM_SIZE: Standard_D2s_v3
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1.1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Test Deploy VM using VHD
run: |
./create-test-vm.sh "$RESOURCE_GROUP" \
"$TEST_VM_NAME" \
"$STORAGE_ACCOUNT_NAME" \
"$STORAGE_CONTAINER_NAME" \
"$BASE_IMAGE_NAME" \
"$REGION" \
"$GITHUB_RUN_ID" \
"$VM_USERNAME" \
"$VM_PASSWORD" \
"$TEST_VM_SIZE"