Merge pull request #14 from zooniverse/mdv5-zooniverse-poc #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Production | |
on: | |
push: | |
branches: | |
- zooniverse-deployment | |
workflow_dispatch: | |
jobs: | |
build_and_push_image: | |
name: Build and Push Image | |
uses: zooniverse/ci-cd/.github/workflows/build_and_push_image.yaml@main | |
with: | |
repo_name: camera-traps-api | |
commit_id: ${{ github.sha }} | |
file: ./api/batch_processing/api_core/Dockerfile | |
latest: true | |
deploy_app: | |
runs-on: ubuntu-latest | |
needs: [build_and_push_image] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_AKS }} | |
- uses: azure/aks-set-context@v3 | |
with: | |
resource-group: kubernetes | |
cluster-name: microservices | |
- name: Dry run deployments | |
run: | | |
sed "s/__IMAGE_TAG__/${{ github.sha }}/g" ./api/batch_processing/api_core/kubernetes/deployment.tmpl \ | |
| kubectl --context azure apply --dry-run=client --record -f - | |
- name: Modify & apply template | |
run: | | |
sed "s/__IMAGE_TAG__/${{ github.sha }}/g" ./api/batch_processing/api_core/kubernetes/deployment.tmpl \ | |
| kubectl --context azure apply --record -f - | |