-
Notifications
You must be signed in to change notification settings - Fork 51
39 lines (30 loc) · 1.57 KB
/
build_images.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
name: Build Images
concurrency: ${{ github.ref }}
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'images/**'
- 'scripts/**'
# - 'builder/**'
jobs:
build:
# runs-on: windows-latest
runs-on: ubuntu-latest
if: "!contains(join(github.event.commits.*.message), '+nobuild')"
env:
STORAGE_ACCOUNT: contosoimagesstorage
SUBNET_ID: /subscriptions/e5f715ae-6c72-4a5c-87c8-495590c34828/resourceGroups/Contoso-Images/providers/Microsoft.Network/virtualNetworks/contoso-images-vnet/subnets/builders
steps:
- uses: actions/checkout@v2
- name: Login to Azure
run: az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
# az cli installs bicep on demand the first time it's used
# using the --async argument in the command below simultaniously invokes several commands that use bicep
# so if bicep isn't already installed, the all initiate the install which throws a file busy error so we
# execute an arbitrary az bicep command here (and get the latest updates in the process)
- name: Ensure Bicep
run: az bicep upgrade
- name: Deploy Build ACI Containers
run: python "./builder/build.py" --async --repository "${{ github.repositoryUrl }}" --revision "${{ github.sha }}" --token "${{ github.token }}" --client-id "${{ secrets.AZURE_CLIENT_ID }}" --client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --storage-account "${{ env.STORAGE_ACCOUNT }}" --subnet-id "${{ env.SUBNET_ID }}"