-
Notifications
You must be signed in to change notification settings - Fork 27
194 lines (176 loc) · 6.99 KB
/
dev-robgruen-docker.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Node.js app to Azure Web App - typeagent
on:
push:
branches:
- dev/robgruen/android_sans_MSAL
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
# build_ts:
# env:
# NODE_OPTIONS: "--max_old_space_size=8192"
# strategy:
# fail-fast: false
# matrix:
# os: ["windows-latest"]
# #os: ["ubuntu-latest", "windows-latest", "macos-latest"]
# #version: [18, 20]
# version: [20]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Setup Git LF
# run: |
# git config --global core.autocrlf false
# - uses: actions/checkout@v4
# - uses: dorny/paths-filter@v3
# id: filter
# with:
# filters: |
# ts:
# - "ts/**"
# - ".github/workflows/build-ts.yml"
# - uses: pnpm/action-setup@v4
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# name: Install pnpm
# with:
# version: 9
# run_install: false
# - uses: actions/setup-node@v4
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# with:
# node-version: ${{ matrix.version }}
# cache: "pnpm"
# cache-dependency-path: ts/pnpm-lock.yaml
# - name: Install dependencies
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# working-directory: ts
# run: |
# pnpm install --frozen-lockfile --strict-peer-dependencies
# - name: Build
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# working-directory: ts
# run: |
# npm run build
# - name: Test
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# working-directory: ts
# run: |
# npm run test
# - name: Lint
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# working-directory: ts
# run: |
# npm run lint
deploy:
runs-on: ubuntu-latest # pnpm deploy does not work currently on Windows. Fails with EPERM.
# needs: build_ts
# environment:
# name: 'test'
# url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
# permissions:
# id-token: write #This is required for requesting the JWT
steps:
- name: Setup Git LF
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ts:
- "ts/**"
- ".github/workflows/build-ts.yml"
- uses: pnpm/action-setup@v4
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
name: Install pnpm
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
with:
node-version: ${{ matrix.version }}
cache: "pnpm"
cache-dependency-path: ts/pnpm-lock.yaml
# - name: Install dependencies
# if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
# working-directory: ts
# run: |
# pnpm install --frozen-lockfile --strict-peer-dependencies
# - name: Set up QEMU
# # Add support for more platforms with QEMU (optional)
# # https://github.com/docker/setup-qemu-action
# uses: docker/setup-qemu-action@v3
- name: Login to Azure
uses: azure/[email protected]
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }}
# - name: Login to Container Registry
# uses: Azure/docker-login@v1
# with:
# # # Container registry username
# username: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
# # # Container registry password
# # password: # default is
# # # Container registry server url
# login-server: typeagentcontainerregistry.azurecr.io
# - name: Login to Container Registry
# uses: docker/login-action@v3
# with:
# registry: typeagentcontainerregistry.azurecr.io
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Build Docker image(s)
# # You may pin to the exact commit or the version.
# # uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
# uses: docker/[email protected]
# with:
# context: .
# file: ts/Dockerfile
# push: false
# tags: typeagent:latest
#- run: az login
#- run: az acr login --name typeageintcontainerregistry
- run: az account show
- run: az account set --subscription b64471de-f2ac-4075-a3cb-7656bca768d0
- run: az account list
- run: az resource list --name typeagentContainerRegistry
- run: ls ${{ github.workspace }} -l
- run: az acr build -t typeAgent:latest -r typeagentContainerRegistry --file ${{ github.workspace }}/ts/DockerFile --subscription b64471de-f2ac-4075-a3cb-7656bca768d0 ${{ github.workspace }}/ts
# - name: Build docker image
# uses: azure/acr-build@v1
# with:
# registry: typeagentcontainerregistry
# branch: dev/robgruen/android_sans_MSAL
# image: typeAgent:latest
# folder: ./ts
# dockerfile: ./ts/Dockerfile
# - name: Docker login
# uses: docker/[email protected]
# with:
# registry: typeagentcontainerregistry.azurecr.io
# steps:
# - name: Download artifact from build job
# uses: actions/[email protected]
# with:
# name: node-app
# - name: Login to Azure
# uses: azure/[email protected]
# with:
# client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
# tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }}
# subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }}
# - name: 'Deploy to Azure Web App'
# uses: azure/[email protected]
# id: deploy-to-webapp
# with:
# app-name: 'typeagent'
# slot-name: 'test'
# package: .