microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
.github/workflows/build-docker-container.yml
66lines · 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 | |
| 13 | permissions: |
| 14 | id-token: write |
| 15 | contents: read |
| 16 | |
| 17 | jobs: |
| 18 | deploy: |
| 19 | environment: development-fork |
| 20 | runs-on: ubuntu-latest # pnpm deploy does not work currently on Windows. Fails with EPERM. |
| 21 | |
| 22 | steps: |
| 23 | - name: Setup Git LF |
| 24 | run: | |
| 25 | git config --global core.autocrlf false |
| 26 | |
| 27 | - uses: actions/checkout@v4 |
| 28 | with: |
| 29 | ref: main |
| 30 | |
| 31 | - uses: dorny/paths-filter@v3 |
| 32 | id: filter |
| 33 | continue-on-error: true |
| 34 | with: |
| 35 | filters: | |
| 36 | ts: |
| 37 | - "ts/**" |
| 38 | - ".github/workflows/build-ts.yml" |
| 39 | |
| 40 | - uses: pnpm/action-setup@v4 |
| 41 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }} |
| 42 | name: Install pnpm |
| 43 | with: |
| 44 | package_json_file: ts/package.json |
| 45 | |
| 46 | - uses: actions/setup-node@v4 |
| 47 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }} |
| 48 | with: |
| 49 | node-version: 22 |
| 50 | #cache: "pnpm" |
| 51 | #cache-dependency-path: ts/pnpm-lock.yaml |
| 52 | |
| 53 | - name: Login to Azure |
| 54 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }} |
| 55 | uses: azure/login@v2.2.0 |
| 56 | with: |
| 57 | client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }} |
| 58 | tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }} |
| 59 | subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }} |
| 60 | |
| 61 | - name: Set up Docker Buildx |
| 62 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }} |
| 63 | uses: docker/setup-buildx-action@v3 |
| 64 | |
| 65 | - if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }} |
| 66 | run: az acr build -t typeagent:latest -r typeagentContainerRegistry --file ${{ github.workspace }}/ts/Dockerfile --subscription ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }} ${{ github.workspace }}/ts |
| 67 | |