| name: Development | |
| on: | |
| push: | |
| branches: | |
| - development | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: Azure/docker-login@v1 | |
| with: | |
| login-server: miralabs.azurecr.io | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - run: | | |
| docker build . -t miralabs.azurecr.io/document-api:${{ github.run_number }} | |
| docker push miralabs.azurecr.io/document-api:${{ github.run_number }} | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: richardrigutins/replace-in-files@v1 | |
| with: | |
| files: "./deployment/deployment.yml" | |
| search-text: '_BUILD__ID_' | |
| replacement-text: '${{ github.run_number }}' | |
| - uses: richardrigutins/replace-in-files@v1 | |
| with: | |
| files: "./deployment/deployment.yml" | |
| search-text: 'CLAIM_NAME' | |
| replacement-text: 'doc-service-pv' | |
| - uses: azure/setup-kubectl@v2.0 | |
| - uses: Azure/k8s-set-context@v2 | |
| with: | |
| kubeconfig: ${{ secrets.KUBE_CONFIG }} | |
| - uses: Azure/k8s-deploy@v4 | |
| with: | |
| action: deploy | |
| namespace: 'mira-dev' | |
| manifests: | | |
| ./deployment/deployment.yml | |
| notify: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send notification to Microsoft Teams | |
| uses: dchourasia/ms-teams-notification@1.1 | |
| with: | |
| github-token: ${{ github.token }} | |
| webhook-uri: ${{ secrets.TEAMS_WEBHOOK_URL }} | |
| card-layout-exit: complete | |
| enable-view-status: true | |
| environment: Development | |
| custom-facts: | | |
| - name: Repository | |
| value: "[Click here to go to the repository](https://github.com/miralabsai/document-service)" | |
| - name: Commit | |
| value: "[Click here to view commit](${{ github.event.repository.url }}/commit/${{ github.sha }})" | |
| - name: Message | |
| value: "${{ github.event.head_commit.message }}" | |
| custom-actions: | | |
| - text: View PR | |
| url: "${{ github.event.repository.url }}/pull/${{ github.event.number }}" | |
| - text: View CI | |
| url: "${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}" |