microsoft/TypeAgent
Publicmirrored from https://github.com/microsoft/TypeAgentAvailable
.github/workflows/build-docker-container.yml
61lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | # This workflow builds a Docker container and deploys it to the TypeAgent container repository |
| 5 | |
| 6 | name: Build and deploy Node.js app to Azure Web App - typeagent |
| 7 | |
| 8 | on: |
| 9 | push: |
| 10 | branches: |
| 11 | - main |
| 12 | workflow_dispatch: |
| 13 | |
| 14 | permissions: |
| 15 | id-token: write |
| 16 | contents: read |
| 17 | |
| 18 | jobs: |
| 19 | deploy: |
| 20 | runs-on: ubuntu-latest # pnpm deploy does not work currently on Windows. Fails with EPERM. |
| 21 | steps: |
| 22 | - name: Setup Git LF |
| 23 | run: | |
| 24 | git config --global core.autocrlf false |
| 25 | |
| 26 | - uses: actions/checkout@v4 |
| 27 | with: |
| 28 | ref: main |
| 29 | |
| 30 | - uses: dorny/paths-filter@v3 |
| 31 | id: filter |
| 32 | with: |
| 33 | filters: | |
| 34 | ts: |
| 35 | - "ts/**" |
| 36 | - ".github/workflows/build-ts.yml" |
| 37 | |
| 38 | - uses: pnpm/action-setup@v4 |
| 39 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }} |
| 40 | name: Install pnpm |
| 41 | with: |
| 42 | package_json_file: ts/package.json |
| 43 | |
| 44 | - uses: actions/setup-node@v4 |
| 45 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }} |
| 46 | with: |
| 47 | node-version: ${{ matrix.version }} |
| 48 | #cache: "pnpm" |
| 49 | #cache-dependency-path: ts/pnpm-lock.yaml |
| 50 | |
| 51 | - name: Login to Azure |
| 52 | uses: azure/login@v2.2.0 |
| 53 | with: |
| 54 | client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }} |
| 55 | tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }} |
| 56 | subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }} |
| 57 | |
| 58 | - name: Set up Docker Buildx |
| 59 | uses: docker/setup-buildx-action@v3 |
| 60 | |
| 61 | - run: az acr build -t typeagent:latest -r typeagentContainerRegistry --file ${{ github.workspace }}/ts/Dockerfile --subscription b64471de-f2ac-4075-a3cb-7656bca768d0 ${{ github.workspace }}/ts |
| 62 | |